If a class is having 4 variables namely type double,type
integer,type string,type decimal.

If we create an instance of that class those variables which
gets into this instance are value types or reference types?

Answer Posted / parmjit

It depends upon member's data type.

If it is of primitive type, structure or enum type, it will
be of value type

Otherwise it will be of reference type.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between array and arraylist c#?

454


Can you store different types in an array in c#?

469


What is sqldataadapter in c#?

483


What is parsing?

524


What is or operator in c#?

531






What is the solution if you need to manipulate sets of items?

464


What is func c#?

490


What is the difference between selection and projection?

429


Define a jagged array in c#?

480


What is the diff between the System.Array.CopyTo() and System.Array.Clone()?

539


Asha buys 16 Chocolates for rs 12 and 24 chocolates for rs 20, if she sold them 30 chocolates for rs 30 then what is the Gain/Loss percentage? Gain(700/19 %) Loss(700/19 %) Gain(500/19 %) Loss(500/19 %) If one person ate 100 grapes in 5 days and 6 more each day from starting, what was the no of grapes he ate on first day? 6 8 10 7 If seven men P, Q, R, S, T, U, V parked his car, P and Q something like that. 6 student J, K, L, M, N, O went for picnic in 2 batches, K and L have to go together, M and O do't go together, if O and L go in one batch then which of these combination will be wrong. Jmnp Jklo klop JKLO a boat can go upstream and down stream, if it goes 5/2 times of downstream at the speed of 6 kmph then what will be the speed of upstream? 15 KMPH 12 KMPH 10 KMPH 11 KMPH A, B, C, D, E sitting on a table, A sits 2 seat left from B and C sits 2 seat right from B then what will not be the combination ACDE

3723


Is string immutable in c#?

568


What is the difference between string and string in c#?

463


If you define a user defined data type by using the class keyword, is it a value type or reference type?

486


Why can’t struct be used instead of class for storing entity?

473