X

Which of the following is the correct way to implement a read only property Length in a Sample class?

( 5 )  .  1 Rating  .  4 Attempts
17 views   .  0 comments  .   . 

Download Solution PDF
  1.  class Sample { int len; public int Length { get { return len; } } }

  2.  class Sample { public int Length { get { return Length; } } }

  3.  class Sample { int len; public int Length { get { return len; } set { len = value; } } }

  4.  class Sample { int len; public int Length { Readonly get { return len; } } }

Give Rating
Report

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

Write Your Comments or Explanations to Help Others
Comments(0)



No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Explore Other Libraries

X




Copyright (c) 2021 TuteeHUB

OPEN APP
Channel Join Group Join