Choose the namespace in which the interface IEnumerable is declared? A. System.Collections System.Collections C. Both A and B D. None of the mentioned B. System.Collections.Generic System.Collections.Generic
or the !i"en set of code what is output? class #ro!ram $ static "oid %ain&strin!'( %ain&strin!'( ar!s) $ int'( nums * $ +, -, /, 0, -1, 2 34 "ar posNums * nums.5here&n nums.5here&n *6 n 7 +0).Select&r *6 r8/)4 Console.5rite&9:he Console.5rite&9:he "alues in nums; 9)4 foreach &int i in posNums) Console.5rite&i < 9 9)4
Console.5rite=ine&)4
Console.>ead=ine&)4 3
3
>un time error Compile time error -+ 0 0 - + + - 0 0 -+
Choose the
System.:et System.Collections.Generic
[email protected]pressions System.=in@ or the !i"en set of code what is output? class #ro!ram $ static "oid %ain&strin!'( %ain&strin!'( ar!s) $
int'( nums * $ +, -, -/, 2 34 "ar posNums * from n in nums orderby n descendin! select n1 4 Console.5rite&9:he Console.5rite&9:he "alues in nums; 9)4 foreach &int i in posNums) Console.5rite&i Console.5rite&i < 9 9)4
Console.5rite=ine&)4
Console.>ead=ine&)4 3 3
>un time error +0 -1 - + 2 - -/ 2 + - -/
System.:et System.Collections.Generic
[email protected]pressions System.=in@ or the !i"en set of code what is output? class #ro!ram $ static "oid %ain&strin!'( %ain&strin!'( ar!s) $
int'( nums * $ +, -, -/, 2 34 "ar posNums * from n in nums orderby n descendin! select n1 4 Console.5rite&9:he Console.5rite&9:he "alues in nums; 9)4 foreach &int i in posNums) Console.5rite&i Console.5rite&i < 9 9)4
Console.5rite=ine&)4
Console.>ead=ine&)4 3 3
>un time error +0 -1 - + 2 - -/ 2 + - -/
or the !i"en set of code what is output representin!?
class #ro!ram $ static "oid %ain&strin!'( %ain&strin! '( ar!s) $ int'( nums * $ +, -, /, 0, -1, 2 34 "ar posNums * from n in nums where n 6 0 select n4 int len * posNums.Count&)4 posNums.Count&)4
Console.5rite=ine&len)4
Console.>ead=ine&)4 3
3
Eecution of code with nothin! bein! printed >un time error Eecution of code with countin! total numbers !reater than ero Eecution of code with printin! all numbers
Select the output for !i"en code snippet; class #ro!ram $ static "oid %ain&strin!'( ar!s) $ int'( nums * $+34
"ar posNums * from n in nums where n 6 0 select %ath.%a&F, )4 Console.5rite&9:he lar!est "alues in nums; 9)4 foreach &int i in posNums) Console.5rite&i < 9 9)4 Console.5rite=ine&)4 Console.>ead=ine&)4 3 3
code run successfully print nothin! Compile time error code run successfully print re@uired output >un time error
5hat will be the output of !i"en code snippet?
class #ro!ram $ static "oid %ain&strin!'( ar!s) $ int'( nums * $ +, -, /, 0, -1, 234 "ar posNums * from n in nums where n 6* 0 select n4 foreach &int i in posNums) Console.5rite&i < 9 9)4
Console.5rite=ine&)4
Console.>ead=ine&)4 3
3
+, /, 2 >un time error 0, +, -, -1, 2 +, /, 0, 2
Select the output for !i"en code snippet;
class #ro!ram $ static "oid %ain&strin!'( ar!s) $ int'( nums * $ +, , 234 "ar posNums * from n in nums where n 6 0 select %ath.S@rt&n)4
Console.5rite&9:he S@uare root "alues in nums; 9)4 foreach &int i in posNums) Console.5rite&i < 9 9)4 Console.5rite=ine&)4 Console.>ead=ine&)4 3 3
>un time error code run successfully print nothin! code run successfully print re@uired output Compile time error
Select the output for !i"en code snippet;
class #ro!ram $ static "oid %ain&strin!'( ar!s) $ int'( nums * $ +, -, /, 0, -1, 2 34 "ar posNums * from n in nums where n 6 -2 HH n 7 orderby n descendin! select n4 Console.5rite&9Descendin! order in nums; 9)4 foreach &int i in posNums) Console.5rite&i < 9 9)4 Console.5rite=ine&)4 Console.>ead=ine&)4 3 3
Compile time error #rint nothin! code run successfully Arran!ed in descendin! order code run successfully
>un time error
#lease read the @uestions carefully and choose the most appropriate option. 5hich of the !i"en options are :>E about the Strin! Class in CJ.NE:?
A strin! built usin! Strin! Class is Immutable. All the listed options A strin! built usin! Strin!Builder Class is %utable. :wo strin!s can be concatenated by usin! an epression of the form s/ * s+ < s4
#lease read the @uestions carefully and choose the most appropriate option.5hich of the followin! components of the .NE: frameworK pro"ide an etensible set of classes that can be used by any .NE: compliant pro!rammin! lan!ua!e? +..NE: class libraries .Component LbMect %odel only Both + and only +
None of the listed options
:he output of code is ?
class test $ public "oid print&) $ Console.5rite=ine&9Csharp;9)4 3 3
class #ro!ram $ static "oid %ain&strin!'( ar!s) $ test t4 t.print&)4 Console.>ead=ine&)4 3 3
Code run and print CsharpO None of the mentioned Code run successfully print nothin! Synta error as t is unassi!ned "ariable which is ne"er used
#lease read the @uestions carefully and choose the most appropriate option.5hich of the !i"en options are :>E?
%ember function of a class are by default pri"ate. All the listed options A pri"ate function of a class can access a public function within the same class. Data members of a class are by default pri"ate.
#lease read the @uestions carefully and choose the most appropriate option.Static procedures can access instance data? State :>E or A=SE?
false true
Select the output for followin! set of code ; class sample $ public int i4 public int M4 public "oid fun&int i, int M) $ this.i * i4 this.M * M4 3 3 class #ro!ram $ static "oid %ain&strin!'( ar!s) $ sample s * new sample&)4 s.i * +4 s.M * 4 s.fun&s.i, s.M)4 Console.5rite=ine&s.i < 9 9 < s.M)4
Console.>ead=ine&)4 3 3
>un successfully but prints nothin!
+ Error as PthisQ reference would not be able to call PiQ and PMQ Error while callin! s.fun&) due to inaccessible le"el
Select output for followin! set of code.
class sample $ public int i4 public int'( arr * new int'+0(4 public "oid fun&int i, int "al) $ arr'i( * "al4 3 3 class #ro!ram $ static "oid %ain&strin!'( ar!s) $ sample s * new sample&)4 s.i * +04 sample.fun&+, 2)4 s.fun&+, 2)4
Console.>ead=ine&)4 3
3
sample.fun&+, 2) will set "alue as 2 in arr'+(
sample.fun&+, 2) will not worK correctly s.i * +0 cannot worK as i is PpublicQ s.fun&+, 2) will worK correctly
5hat do the followin! code implies ? csharp abc4 abc * new csharp&)4 create an obMect of type csharp on stacK Create an obMect of type csharp on heap or on stacK dependin! on whether csharp is class or struct LbMect creation on class csharp Create an obMect of type csharp on heap or on stacK dependin! on sie of obMect
#lease read the @uestions carefully and choose the most appropriate option.5hich of the !i"en options CANNL: be a tar!et for custom attribute? E"ent Namespace Dele!ate All the listed options
Select output for followin! set of code. class sample $ public int i4 public int'( arr * new int'+0(4 public "oid fun&int i, int "al) $ arr'i( * "al4 3
3 class #ro!ram $ static "oid %ain&strin!'( ar!s) $ sample s * new sample&)4 s.i * +04 sample.fun&+, 2)4 s.fun&+, 2)4
Console.>ead=ine&)4 3
3
sample.fun&+, 2) will not worK correctly s.fun&+, 2) will worK correctly sample.fun&+, 2) will set "alue as 2 in arr'+( s.i * +0 cannot worK as i is PpublicQ
Select output for followin! set of code ; CLN:>L= S:>C:>ES static "oid %ain&strin!'( ar!s) $ int 4 for & * +04 7* +24 <<) while &Con"ert.:oBoolean&Con"ert.:oInt/&))) $ do $
Console.5rite=ine&+)4 if &Con"ert.:oBoolean& 66 +))
continue4 3while &Con"ert.:oBoolean&0))4
breaK4 3
Console.>ead=ine&)4
3
0 0 0R.innite times System outoTow eception error. + + + + + + ;ans + + +R.innite times
Select output for followin! set of code ; static "oid %ain&strin!'( ar!s) $ int i, s * 0, a * +, d4 i * Con"ert.:oInt/&Console.>ead=ine&))4 do $ d * i 8 & 1)4 s * s < d a4 3while &&Con"ert.:oInt/&i * i & 1))) U* 0 HH &Con"ert.:oBoolean&Con"ert.:oInt/&&a) * &a +0)))))4
Console.5rite=ine&s)4
Console.>ead=ine&)4
3 enter i * /1.
It nds re"erse of i It nds binary e@ui"alent of i It nds sum of di!its of i It nds octal e@ui"alent of i
5hich of these is not a correct statement? >ecursion always uses stacK >ecursi"e methods are faster that pro!rammers written loop to call the function repeatedly usin! a stacK >ecursion is always mana!ed by CJ >untime en"ironment A recursi"e method must ha"e a base case
5hat will be the output for !i"en set of code? static "oid %ain&strin!'( ar!s) $ int n * +4
method&n)4
Console.5rite=ine&n)4 method+&ref n)4
Console.5rite=ine&n)4
Console.>ead=ine&)4 3 static "oid method&int num) $ num <* 04
Console.5rite=ine&num)4 3 static "oid method+&ref int num)
$ num <* 04
Console.5rite=ine&num)4 3
+ + + +
++ + + ++
+ + + +
+ + + +
5hat will be the output for !i"en set of code? static "oid %ain&strin!'( ar!s) $
int '(arr * new int'($ +, , /, 1, 234 fun &ref arr)4 for &int i * 04 i 7 arr.=en!th 4 i<<) Console.5rite=ine& arr'i( < 9 9)4 3 static "oid fun&ref int'(a) $ a * new int'(4 a'/( * /4 a'+( * 14 3
0 1 0 / 0 0
0 0 / 0 0 0
1 0
/ 0 0 0
0 0 / 0 0 0
5hat is >ecursion in CSharp dened as? >ecursion another process of denin! a method that calls other methods repeatedly >ecursion another form of class >ecursion is a process of denin! a method that calls other methods which in turn call a!ain this method >ecursion is a process of denin! a method that calls itself repeatedly
#lease read the @uestions carefully and choose the most appropriate option.5hich of the !i"en options are :>E? +.A switch statement can act on numerical as well as Boolean types. .A switch statement can act on characters, strin!s and enumerations types.
None of the listed options only + Both + and only
5hat will be the correct output for !i"en code snippet? class maths $ public int fact&int n) $ int result4 if &n ** +) return +4 result * fact&n - +) n4 return result4 3 3 class Lutput $ static "oid %ain&Strin!'( ar!s) $ maths obM * new maths&) 4 Console.5rite=ine&obM.fact&1)obM.fact&))4 3 3
0 1F 1 +0
5hich method does followin! set of code eplains? static "oid %ain&strin!'( ar!s)
$ int a * +0, b * 04 method&ref a, ref b)4 console.writeline&a < 9 9 < b)4 3 static "oid swap&ref int i, ref int M) $ int t4 t * i4 i * M4 M * t4 3
Call by reference Call by "alue parameter arrays Lutput parameter
5hat will be the correct output for !i"en code snippet? class maths $ public int fact&int n) $ int result4 if &n ** +) return +4 result * fact&n - +) n4 return result4
3 3 class Lutput $ static "oid %ain&Strin!'( ar!s) $ maths obM * new maths&)4
Console.5rite=ine&obM.fact&+))4
Console.>ead=ine&)4 3 3
+ +0 0
5hat is output of followin! set of code? static "oid %ain&strin!'( ar!s) $ #ro!ram p * new #ro!ram&)4 p.display&, /, F)4 int '(a * $ , 2, F, 34 Console.5rite=ine&9eample of array9)4 Console.5rite=ine&9elements added are9)4 p.display&a)4 Console.>ead=ine&)4 3
public "oid display¶ms int'( b) $ foreach &int i in b) $ Console.5rite=ine&9A>>AV IS WAXING;$039, i)4 3 3
Code runs successfully but prints nothin! Code runs successfully and prints !i"en on console >un time error Compile time error
#lease read the @uestions carefully and choose the most appropriate option.An enum that is declared inside a class, struct, namespace or interface is treated as public. State :rue or alse.
false true
5hat will be the output of !i"en code snippet? class #ro!ram $ static "oid %ain&strin!'( ar!s) $ char '(chars * $YaY, YbY, YcY34 Strin! s * new Strin!&chars)4
Console.5rite=ine&s)4 Console.>ead=ine&)4 3 3
c a abc b
5hat will be the output of !i"e code snippet?
class #ro!ram $ static "oid %ain&strin!'( ar!s) $ Strin! s+ * 9Wello i lo"e Csharp94 Strin!Builder s * new Strin!Builder&s+)4 Console.5rite=ine&s+.E@uals&s))4 Console.>ead=ine&)4 3 3 Compile time error true alse 0
Choose the correct output for !i"en set of code?
enum per $ a, b, c, d, 3 per.a * +04 Console.writeline&per.b)4
++ Compile time error +
Select correct declaration of denin! array of parameters; "oid func&int'( ) $ 3
"oid func&int ) $ 3 "oid fun¶m int'( ) $
3
"oid func¶m int'() $ 3
#lease read the @uestions carefully and choose the most appropriate option.5hich of the !i"en options are :>E about enumerators? +.:he "alue of each successi"e enumerator is decreased by +. .Xalues of enum elements cannot be populated from a database.
None of the listed options only + only Both + and
5hat will be the output of !i"en code snippet? static "oid %ain&strin!'( ar!s) $ strin! s+ * 9 I!94 strin! s * s+.Insert&/,9i9)4 strin! s/ * s.Insert&2, 9o9)4 for &int i * 04 i 7 s/.=en!th4 i<<) Console.5rite=ine&s/'i()4 Console.>ead=ine&)4 3
I!o Ii!
Ii!o Ii!o
#lease read the @uestions carefully and choose the most appropriate option.5hat is the sie of a Decimal data type?
/ byte 1 byte + byte F byte
5hat will be the output of !i"en set of code? static "oid %ain&strin!'( ar!s) $ int'( * $2, , , F, , 034
fun&)4
Console.>ead=ine&)4
3 static "oid fun¶ms int'( b ) $ int i4 for &i * 24 i 6 0 4 i--) $ b'i( * b'i( < /4
Console.5rite=ine&Con"ert.:oChar&b'i())4 3
3 , E, D, C, B, A A, B, C, D, E,
f, e, d, c, b b, c, d, e, f Access speciers What will be size of object created depicted by csharp code snippet? class baseclass { private int a; protected int b; public int c; } class derived : baseclass { private int x; protected int y; public int z; } class Progra { static !oid "ain#string$% args& { derived a ' new derived#&; } } () bytes (* bytes +, bytes +( bytes What will be the output of given code snippet? class access { public int x; private int y; public void cal#int a- int b& { x ' a . +; y ' b; } } class Progra { static void "ain#string$% args& {
access obj ' new access#&; obj/cal#(- 0&; 1onsole/Write2ine#obj/x . 3 3 . obj/y&; } }
4un tie error 1opile tie error 00 (0 What will be the output of given code snippet? class access { public int x; private int y; public void cal#int a- int b& { x ' a . +; y ' b; } public void print#& { 1onsole/Write2ine#3 3 . y&; } } class Progra { static void "ain#string$% args& { access obj ' new access#&; obj/cal#(- 0&; 1onsole/Write2ine#obj/x&; obj/print#&; 1onsole/4ead2ine#&; } }
4un tie error 00 (0 1opile tie error
What will be the output of following set of code? class su { public int x; public int y; public int add #int a- int b& { x ' a . b; y ' x . b; return ); } } class Progra { static void "ain#string$% args& { su obj+ ' new su#&; su obj( ' new su#&; int a ' (; obj+/add#a- a . +&; obj(/add#5- a&; 1onsole/Write2ine#obj+/x . 3 3 . obj(/y&; 1onsole/4ead2ine#&; } }
6- +) 0- ( 5- 6 ,- 6 What will be the output of following set of code? class static7out { public static int x; public static int y; public int add#int a- int b& { x ' a . b; y ' x . b; return ); } } class Progra { static void "ain#string$% args&
{ static7out obj+ ' new static7out#&; static7out obj( ' new static7out#&; int a ' (; obj+/add#a- a . +&; obj(/add#5- a&; 1onsole/Write2ine#static7out/x . 3 3 . static7out/y &; 1onsole/4ead2ine#&; } }
,, 88 86 68 What will be the output of following set of code? class su { public int x; private int y; public void ath#int a- int b& { x ' a 9 *; y ' b; } } class Progra { static void "ain#string$% args& { su p ' new su#&; p/ath#+(- 0)&; 1onsole/Write2ine#p/x . 3 3 . p/y&; 1onsole/4ead2ine#&; } }
)- ) *- ) *- 0) 1opile tie error
ccessibility odifier defined in a class are?
public- internal- protected internal/ public- private- internal- protected internal/ public- private- protected public- private- protected- internal- protected internal What will be the output of code? class ath { public int a-b; public ath#int i- int j& { a ' i; b ' j; } public void su#ath & { /a 9' (; /b .' (; } } class Progra { static void "ain#string$% args& { ath t ' new ath#()- +)&; t/su#t&; 1onsole/Write2ine#t/a . 3 3 . t/b&; 1onsole/4ead2ine#&; } }
*)- +( 5- *) +)- () ()- +) class test { public int a; public int b;
public test#int i- int j& { a ' i; b ' j; } public void eth#test o& { o/a 9' (; o/b <' (; } } class Progra { static void "ain#string$% args& { test obj ' new test#+)- ()&; obj/eth#obj&; 1onsole/Write2ine#obj/a . 3 3 . obj/b&; 1onsole/4ead2ine#&; } }
*)- () +)- () ()- *) ()- +) Which of these is used as default specifier for a eber of class if no access specifier is used for it?
protected public- within its own class private public
Basics 1hoose the class on which all strea classes are defined?
ll of the entioned
=yte/>nput/strea =yste/utput/strea =yste/>/strea ethod used to write a single byte to an output strea?
4ead#& write#& void Write@yte#byte value& int Write#byte$% buffer -int offset -int count&
Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar +/Bhe attributes applied can be read fro an assebly using 4eflection class/ (/n attribute can have paraeters/ only + Fone of the listed options @oth + and ( only ( Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar +/rrays can be rectangular or jagged/ (/4ectangular arrays have siilar rows stored in adjacent eory locations/ Fone of the listed options only ( only + @oth + and ( Please read the Auestions carefully and choose the ost appropriate option/4ead the below stateents ca =tateent +: "anaged code is the code that is copiled by the G>B copilers/ =tateent (: "anaged code is the code where resources are Harbage 1ollected/ Which of the above stateents are B4CD about "anaged 1ode? ll stateents are true
nly =tateent ( is true Fone of the stateents is true nly =tateent + is true Please read the Auestions carefully and choose the ost appropriate option/4ead the below stateents ca =tateent +: 124 provides services to run 3anaged3 applications/ =tateent (: Bhe resources are garbage collected/ =tateent 0: 124 provides services to run 3unanaged3 applications/ Which of the following stateents are B4CD about the /FDB 124?
ll stateents are true nly =tateents + and ( are true nly =tateent 0 is true nly =tateent ( is true 1hoose the fileode ethod which is used to create a new output file with condition that file with sae n
Iile"ode/penr1reate Iile"ode/Bruncate Iile"ode/1reate Iile"ode/1reateFew Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar +/@y position (/@y nae only + only ( @oth + and ( Fone of the listed options Which aong is used for storage of eory aspects?
@uffered=trea
Fone of the entioned "eory=trea Iile=trea
Class Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar
=tatic functions of a class never receive the JthisJ reference/ thisJ reference can be odified in the instance eber function of a class/ ll the listed options thisJ reference continues to exist even after control returns fro an instance eber function/ Please read the Auestions carefully and choose the ost appropriate option/With which of the given opti +/=tatic data (/>nstance data only + only ( @oth + and ( Fone of the listed options Please read the Auestions carefully and choose the ost appropriate option/Which of the given options a
ll the listed options Lata ebers of a class are by default private/ private function of a class can access a public function within the sae class/ "eber function of a class are by default private/
Select the output for following set of code : class sample {
public int i; public int j; public void fun(int i, int j) { this.i = i; this.j = j; class !rogram { static void "ain(string#$ "ain(string#$ args) { sample s = new sample(); s.i = %; s.j = &; s.fun(s.i, s.j); 'onsole.riteine (s.i * + + * s.j); 'onsole.eadine();
Drror as MthisN reference would not be able to call MiN and MjN 4un successfully but prints nothing Drror while calling s/fun#& due to inaccessible level +( =elect the output for following set of code : class z { public string nae+; public string address; public void show#& { 1onsole/Write2ine#3{)} is in {+}3- nae+- address&; } } class Progra { static void "ain#string$% args& { z n ' new z#&; n/nae+ ' 3harsh3; n/address ' 3new delhi3; n/show#&; 1onsole/4ead2ine#&; 1onsole/4ea d2ine#&; } } 4un successfully prints nothing =yntax error
{)} is in city{+} harsh new delhi harsh is in new delhi What is ost specified using class declaration ? scope type O scope type Fone of entioned
!lease read the -uestions carefull and choose the most appropriate option .hich of the given options '/0012 be a target for custom attribute3
ll the listed options Lelegate Faespace Dvent Please read the Auestions carefully and choose the ost appropriate option/Bhe string built using the =trin =tring@uilder class are utable/ =tate B4CD or I2=D/ true false
Select the output for following set of code : class sample { public int i; public int j; public void fun(int i, int j) { this.i = i; this.j = j; class !rogram { static void "ain(string#$ args) { sample s = new sample(); s.i = %; s.j = &; s.fun(s.i, s.j); 'onsole.riteine(s.i * + + * s.j); 'onsole.eadine();
Drror while calling s/fun#& due to inaccessible level 4un successfully but prints nothing Drror as MthisN reference would not be able to call MiN and MjN +(
Select output for following set of code. class sample { public int i; public int#$ arr = new int#%4$; public void fun(int i, int val) { arr#i$ = val; class !rogram { static void "ain(string#$ args) { sample s = new sample(); s.i = %4; sample.fun(%, 5); s.fun(%, 5); 'onsole.eadine();
saple/fun#+- 5& will set value as 5 in arr$+% s/fun#+- 5& will worK correctly saple/fun#+- 5& will not worK correctly s/i ' +) cannot worK as i is MpublicN
2he output of code is 3 class test { public void print() { 'onsole.riteine(+'sharp:+); class !rogram { static void "ain(string#$ args)
{ test t; t.print(); 'onsole.eadine();
Fone of the entioned 1ode run and print Q1sharpR 1ode run successfully print nothing =yntax error as t is unassigned variable which is never used =elect the output for following set of code : class z { public int S; public int T; public const int c+ ' 5; public const int c( ' c+ 9 (5; public void set#int a- int b& { S ' a; T ' b; } } class Progra { static void "ain#string$% args& { z s ' new z#&; s/set#+)- ()&; 1onsole/Write2ine#s/S . 3 3 . s/T&; 1onsole/Write2ine#z/c+ . 3 3 . z/c(&; 1onsole/4ead2ine#&; } } () +) () +) +) () +) () 5 +(5 What do the following code iplies ? csharp abc; abc ' new csharp#&; bject creation on class csharp
1reate an object of type csharp on heap or on stacK depending on size of object create an object of type csharp on stacK 1reate an object of type csharp on heap or on stacK depending on whether csharp is class or struct What is ost specified using class declaration ? Fone of entioned type O scope type scope Please read the Auestions carefully and choose the ost appropriate option/=tatic procedures can access in true false
!lease read the -uestions carefull and choose the most appropriate option.hich of the following components of the .062 framewor language3 %..062 class libraries &.'omponent 1bject "odel
only ( @oth + and ( Fone of the listed options only +
Console
What is output returned by 1onsole if 4ead2ine#& stores >< error?
false ) + >< DS1DPB>F D444 1hoose the output returned when error condition generates while read#& reads fro the console/
) + false ll the given options Which aong the following ethods used writes characters to a string?
=tringWriter =trea4eader =treaWriter Fone
=elect the correct input ethods provided by 1onsole? 4ead2ine#& 4eadUey#&- 4ead2ine#& 4ead#&- 4ead2ine#& 4ead#&- 4ead2ine#&- 4eadUey#& Which ethod in 1onsole enables to read individual inputs directly fro the Keyboard in a non line buffer 4eadUey#& 4ead2ine#& ll the given options 4ead#& Which of these ethod used to read string fro the console?
read2ine#& read#& get#& getline#&
hich of these method9methods used to read bloc7 or arra of btes from the file3
4ead@yte#& 4ead#& 4eadKey#& 4ead2ine#& 1hoose the object of Bext4eader class/
1onsole/>n 1onsole/Drror Fone 1onsole/ut
'hoose the methods provided b 'onsole.1ut and 'onsole.6rror3
4eadUey WriteUey 4ead2ine Write2ine
'hoose the output return when read() reads the character from the console3
@oolean =tring 1har >nteger
'hoose the output for following set of code3
static void "ain(string#$ args) { 'onsole.riteine(+2his is a 'onsole /pplication:+); 'onsole.rite(+!lease enter our luc7 number:+); string val% = 'onsole.eadine(); int val& = Sstem.'onvert.2ont&(val%, %4); val& = val& < val&; 'onsole.riteine(+s-uare of number is:+ *val&); 'onsole.ead();
4un successfully asK for input and hence display the results 1opile tie error 4un successfully donot prints anything =yntax Drror What would be the output for following input fro the console as a character? static void "ain#string$% args& { 1onsole/Write2ine#3what is your nae?3&; char s; s ' 1onvert/Bo1har#1onsole/4ead2ine#&&; 1onsole/Write2ine#3how are you: 3.s&; 1onsole/4ead#&; }
4un tie error 1ode run successfully prints nothing on console 1opile tie error 1ode run successfully prints input on console
0ame the e8ception thrown b read() on failure.
=yste>nputDxception >nterruptedDxception >< Dxception =ysteDxception
Which of these methods are used to read single character from the console? a) get() b) getline() c) read() d) readLine() Console
What is output returned by 1onsole if 4ead2ine#& stores >< error?
false ) + >< DS1DPB>F D444 1hoose the output returned when error condition generates while read#& reads fro the console/ ) + false ll the given options Which aong the following ethods used writes characters to a string?
=tringWriter =trea4eader =treaWriter Fone
=elect the correct input ethods provided by 1onsole? 4ead2ine#& 4eadUey#&- 4ead2ine#& 4ead#&- 4ead2ine#&
4ead#&- 4ead2ine#&- 4eadUey#& Which ethod in 1onsole enables to read individual inputs directly fro the Keyboard in a non line buffer 4eadUey#& 4ead2ine#& ll the given options 4ead#& Which of these ethod used to read string fro the console?
read2ine#& read#& get#& getline#&
hich of these method9methods used to read bloc7 or arra of btes from the file3
4ead@yte#& 4ead#& 4eadKey#& 4ead2ine#& 1hoose the object of Bext4eader class/
1onsole/>n 1onsole/Drror Fone 1onsole/ut
'hoose the methods provided b 'onsole.1ut and 'onsole.6rror3
4eadUey WriteUey 4ead2ine Write2ine
'hoose the output return when read() reads the character from the console3
@oolean =tring 1har >nteger
'hoose the output for following set of code3 static void "ain(string#$ args) { 'onsole.riteine(+2his is a 'onsole /pplication:+); 'onsole.rite(+!lease enter our luc7 number:+); string val% = 'onsole.eadine(); int val& = Sstem.'onvert.2ont&(val%, %4); val& = val& < val&; 'onsole.riteine(+s-uare of number is:+ *val&); 'onsole.ead();
4un successfully asK for input and hence display the results 1opile tie error 4un successfully donot prints anything =yntax Drror What would be the output for following input fro the console as a character? static void "ain#string$% args& { 1onsole/Write2ine#3what is your nae?3&; char s; s ' 1onvert/Bo1har#1onsole/4ead2ine#&&;
1onsole/Write2ine#3how are you: 3.s&; 1onsole/4ead#&; }
4un tie error 1ode run successfully prints nothing on console 1opile tie error 1ode run successfully prints input on console
0ame the e8ception thrown b read() on failure.
=yste>nputDxception >nterruptedDxception >< Dxception =ysteDxception
Which of these methods are used to read single character from the console? a) get() b) getline() c) read() d) readLine() Constructor
Please read the Auestions carefully and choose the ost appropriate option/Which of given options is B4C
constructor cannot be overloaded/ constructor can be a static constructor/ constructor cannot be declared as private/ Fone of the given options
hat will be the output of given set of code3
class maths { int i; public maths(int 8) { i = 8; 'onsole.riteine(+hello:+); class maths% : maths { public maths%(int 8) :base(8) { 'onsole.riteine(+be+); class !rogram { static void "ain(string#$ args) { maths% 7 = new maths%(%&); 'onsole.eadine();
bye +( hello: bye +( hello 1opile tie error What will be the output of given set of code? class aths { public int length; public int breadth; public aths#int x& { length ' x . +; } public aths#int x- int y& { length ' x . (; } } class Progra {
static void "ain#string$% args& { aths ' new aths#,&; aths K ' new aths#,- (&; 1onsole/Write2ine#/length&; 1onsole/Write2ine#K/length&; 1onsole/4ead2ine#&; } }
What will be the output of given set of code? class aths { public int length; public int breadth; public aths#int x- int y& { length ' x; breadth ' y; 1onsole/Write2ine#x . y&; } public aths#double x- int y& { length ' #int&x; breadth ' y; 1onsole/Write2ine#x 9 y&; } } class Progra { static void "ain#string$% args& { aths ' new aths#()- *)&; aths K ' new aths#+(/)- +(&; 1onsole/4ead2ine#&; } } ,)
+**/) ,) (* ,) +** ,) ) What will be the output of given set of code? class aths { static aths#& { int s ' ; 1onsole/Write2ine#s&; } public aths#int f& { int h ' +); 1onsole/Write2ine#h&; } } class Progra { static void "ain#string$% args& { aths p ' new aths#)&; 1onsole/4ead2ine#&; } }
What will be the output of given set of code? class aths {
int i; public aths#int ii& { ii ' (5; int g; g ' ii V ) ? ii : ii 9 +; 1onsole/Write2ine#g&; }
} class aths+ :aths { public aths+#int ll& :base#ll& { ll ' +))); 1onsole/Write2ine##ll V ) ? ll : ll 9 +&&; } } class Progra { static void "ain#string$% args& { aths+ p ' new aths+#,&; 1onsole/4ead2ine#&; } } +)(5 (5 +))) +)(5 Fone of entioned What will be the output of given set of code? class aths { public aths#& { 1onsole/Write2ine#3constructor + :3&; } public aths#int x& { int p ' (; int u; u ' p . x; 1onsole/Write2ine#3constructor (: 3 .u&; } } class Progra {
static void "ain#string$% args& { aths K ' new aths#*&; aths t ' new aths#&; 1onsole/4ead2ine#&; }
} constructor +: constructor (: , Fone of the entioned constructor (: , constructor (: , constructor (: , constructor +: What will be the output of given set of code? class aths { int i; public aths#int ii& { ii ' +(; int j ' +(; int r ' ii 9 j; 1onsole/Write2ine#r&; } } class aths+ : aths { public aths+#int u& :base#u& { u ' +0; int h ' +0; 1onsole/Write2ine#u . h&; } } class aths( : aths+ { public aths(#int K& :base#K& { K ' (*; int o ' , ; 1onsole/Write2ine#K
static void "ain#string$% args& { aths( t ' new aths(#+)&; 1onsole/4ead2ine#&; } } (, * +** * (, +** +** (, * ) ) ) Please read the Auestions carefully and choose the ost appropriate option/ow any ties can a constru nly once s any ties as we call it Bwice ny nuber of ties before the object gets garbage collected/ 1orrect stateents about constructor overloading in 1E is? verloaded constructors have sae nae as the class nae verloaded constructors can use optional arguents verloaded constructors can have different type of nuber of argueents as well as differ in nub ll the given options
Control structures =elect the output for following set of code : static void "ain#string$% args&
{ int x ' ); do { x..; if #x '' 5& { x..; continue; breaK; } 1onsole/Write2ine#x . 3 3&; }while #x X +)&; } +) 5 , 8 6 +) +(0*5 + ( 0 * 8 6 +) =elect output for following set of code : static void "ain#string$% args& { int i ' +- j ' (- K ' 0; do { 1onsole/Write2ine##1onvert/Bo@oolean#1onvert/Bo>nt0(#i..&&& OO #1onvert/Bo@oolean#1onvert/Bo> }while #i X' 0&; 1onsole/4ead2ine#&; }
+++ ))) Brue Brue Brue Ialse Ialse Ialse
hat will be the output for given set of code3 static void "ain(string#$ args) { int #$arr = new int#${ %, &, , , 5; fun (ref arr);
for (int i = 4; i > arr.ength ; i**) 'onsole.riteine( arr#i$ * + +); static void fun(ref int#$a) { a = new int#?$; a#$ = &; a#%$ = &;
Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar +/Bhe goto stateent passes control to the next iteration of the enclosing iteration stateent in which it a
(/@ranching is perfored using jup stateents which cause an iediate transfer of the progra contr @oth + and ( Fone of the listed options only ( only + What is output for following code snippet? class Progra { static void "ain#string$% args& { int i ' 5; int j; ethod+#ref i&; ethod(#out j&; 1onsole/Write2ine#i . 3 3 . j&; } static void ethod+#ref int x& { x ' x . x; } static void ethod(#out int x& { x ' ,; x ' x 9 x; } } 0, +) +) 0, )) 0, )
Select the output for following set of 'ode: static void "ain(string#$ args) { int i; i = 4; while (i** > 5) { 'onsole.riteine(i);
'onsole.riteine(+@n+); i = 4; while ( **i > 5) { 'onsole.riteine(i); 'onsole.eadine();
+(0*5 +(0* +(0 +(0* +(0* +(0*5 +(0*5 +(0*5 =elect the output for following set of code : static void "ain#string$% args& { int x; for #x ' +; x X' 0; x..& { int j ' +; do { j..; }while #x Y j '' (&; 1onsole/Write2ine#x . 3 3 . j&; } 1onsole/4ead2ine#&; } ++ +( +0 ++ (+ 0+
++ +( +0 +( (( 0( Which of these data types is used by operating syste to anage the 4ecursion in 1sharp?
rray Bree =tacK Zueue =elect output for following set of code : static void "ain#string$% args& { int i- s ' )- a ' +- d; i ' 1onvert/Bo>nt0(#1onsole/4ead2ine#&&; do { d ' i Y #( 9 *&; s ' s . d 9 a; }while ##1onvert/Bo>nt0(#i ' i < #( 9 *&&& [' ) OO #1onvert/Bo@oolean#1onvert/Bo>nt0(##a& ' #a 9 +)& 1onsole/Write2ine#s&; 1onsole/4ead2ine#&; } enter i ' 0*(/
>t finds octal eAuivalent of i >t finds binary eAuivalent of i >t finds su of digits of i >t finds reverse of i What will be the output for given set of code? static void Main(string[] args) {
int n = 1; method(n); onsole!WriteLine(n); method1(ref n); onsole!WriteLine(n); onsole!"eadLine(); # static void method(int num) { num $= %&; onsole!WriteLine(num); # static void method1(ref int num) { num $= %&; onsole!WriteLine(num); #
=elect the output for following set of code : static void "ain#string$% args& { long x; x ' 1onvert/Bo>nt0(#1onsole/4ead2ine#&&;
do { 1onsole/Write2ine#x Y +)&; }while ##x ' x < +)& [' )&; 1onsole/4ead2ine#&;
} enter x ' +(0*/
nuber of digits present in x prints su of digits of MxN prints N+\ prints reverse of x =elect output for following set of code : static void "ain#string$% args& { float i ' +/)f- j ' )/)5f; do { 1onsole/Write2ine#i.. ..j&; }while #i X (/)f OO j X' (/)f&; 1onsole/4ead2ine#&; }
)/)5 )/)5 )/)*666665 )/65
!redict the output for following set of code : static void "ain(string#$ args) { int 8; 8 = 'onvert.2ont&('onsole.eadine()); int c = %; while (c >= 8) { if (c A & == 4) { 'onsole.riteine(+68ecute while + * c * +@t+ * +time+);
c**; 'onsole.eadine(); for 8 = B.
Dxecute while ( tie Dxecute while 0 tie Dxecute while * tie Dxecute while 5 tie Dxecute while ( tie Dxecute while * tie Dxecute while , tie Dxecute while tie Dxecute while + tie Dxecute while ( tie Dxecute while 0 tie Dxecute while * tie Dxecute while 5 tie Dxecute while , tie Dxecute while 8 tie Dxecute while + tie Dxecute while 0 tie Dxecute while 5 tie Dxecute while 8 tie =elect the output for following set of code: static void "ain#string$% args& { float s ' )/+f; while #s X' )/5f& { ..s; 1onsole/Write2ine#s&; } 1onsole/4ead2ine#&; }
)/+ )/( )/0 )/* )/5 +/+ )/+ Fo output =elect the output for following set of code: static void "ain#string$% args& { float s ' )/+f; while #s X' )/5f& { ..s; 1onsole/Write2ine#s&; } 1onsole/4ead2ine#&; }
)/+ )/( )/0 )/* )/5 +/+ )/+ Fo output Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ca +/breaK (/goto only + @oth + and ( Fone of the listed options only ( Which of these is not a correct stateent?
4ecursion is always anaged by 1E 4untie environent 4ecursive ethods are faster that prograers written loop to call the function repeatedly using recursive ethod ust have a base case
4ecursion always uses stacK
hat is ecursion in 'Sharp defined as3
4ecursion is a process of defining a ethod that calls other ethods which in turn call again this 4ecursion is a process of defining a ethod that calls itself repeatedly 4ecursion another for of class 4ecursion another process of defining a ethod that calls other ethods repeatedly =elect the output for following set of 1ode: static void "ain#string$% args& { int i; i ' ); while #i.. X 5& { 1onsole/Write2ine#i&; } 1onsole/Write2ine#3]n3&; i ' ); while # ..i X 5& { 1onsole/Write2ine#i&; } 1onsole/4ead2ine#&; }
+(0 +(0* +(0*5 +(0* +(0* +(0*5 +(0*5 +(0*5 =elect output for following set of code :
static void "ain#string$% args& { int i ' +- j ' (- K ' 0; do { 1onsole/Write2ine##1onvert/Bo@oolean#1onvert/Bo>nt0(#i..&&& OO #1onvert/Bo@oolean#1onvert/Bo> }while #i X' 0&; 1onsole/4ead2ine#&; }
+++ ))) Brue Brue Brue Ialse Ialse Ialse =elect the output for following set of 1ode: static void "ain#string$% args& { int x ' ); while #x X ()& { while #x X +)& { if #x Y ( '' )& { 1onsole/Write2ine#x&; } x..; } } 1onsole/4ead2ine#&; }
)(*, + ( 0 * 5 , 8 6 +) ++ +( +0 +* +5 +, +8 + +6 () ) ( * , +) ) ( * , +) +( +* +, + ()
aData types
Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar +/Bhe value of each successive enuerator is decreased by +/ (/!alues of enu eleents cannot be populated fro a database/ Fone of the listed options only + only ( @oth + and (
hat is output for following set of code 3 static void "ain(string#$ args) { double a = 5.4C; bte c = (bte) a; 'onsole.riteine(c); 'onsole.eadine();
1orrect output for the 1E/FDB code given below is? enum colors { red' blac' in #
static void Main(string[] args) { colors s = colors!blac; *+e t; t = s!,et*+e(); string[] str; str = -num!,et.ames(t); onsole!WriteLine(str[&]); onsole!"eadLine(); # blacK )
red + Which of these ethod of class =tring is used to checK whether a given string starts with a particular subst Dnds#& =tartsWith#& =tarts#& DndsWith#& What will be the output of give code snippet? class Progra { static void "ain#string$% args& { =tring s+ ' 3ello i love 1sharp3; =tring@uilder s( ' new =tring@uilder#s+&; 1onsole/Write2ine#s+/DAuals#s(&&; 1onsole/4ead2ine#&; } } 1opile tie error true Ialse )
!lease read the -uestions carefull and choose the most appropriate option.hich of the given options are 2D6 about enumerators3 %./nenum variable can be defined inside a class or a namespace. &./nenum variable cannot have a protected access modifier.
only + Fone of the listed options only ( @oth + and ( Please read the Auestions carefully and choose the ost appropriate option/Which of the given options are =tring is created on the stacK/ =tring is created on the heap/ =tring is a priitive/ Fone of the given options 1hoose the correct output for given set of code?
enu per { abcd} per/a ' +); 1onsole/writeline#per/b&; ( 1opile tie error + ++
'hoose the correct output for given set of code3 enumcolor:int { red, green, blue = 5, can, pin7 = %4, brown static void "ain(string#$ "ain(string#$ args) { 'onsole.riteine((int)color.green); 'onsole.riteine((int)color.brown);
+ ++ +5 ( +) ( ++
What will be the output of set of code? static void "ain#string$% args& { int $% a ' {+- (- 0- *- 5}; fun#a&; 1onsole/4ead2ine#&; }
static void fun#parasint$% b & { int$% K ' { 0- *- 8- -J])J }; for #inti ' ); iXb/2ength; i..& { b$i% ' b$i% . K$i% ; 1onsole/Write2ine# 1onsole/Wr ite2ine# b$i% . 3 3&; } }
*- ,- +)- +(- 5 0- *- 8- - 5 1opile tie error 0- *- 8- - 5- +- (- 0- *- 5
Data types Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar
=tring is created on the heap/ Fone of the given options =tring is a priitive/ =tring is created on the stacK/
please read the Auestions carefully and choose the ost appropriate option/Which of the given data types
long int byte short
2he modifiers used to define an arra of parameters or lists of arguements:
ref para
var out 1hoose the correct output for given set of code? enu per { abcd} per/a ' +); 1onsole/writeline#per/b&; ( ++ 1opile tie error + What will be the output of given set of code? static void "ain#string$% args& { int$% x ' { )- (- ,5- 8(- 0- ,8 }; fun#x&; 1onsole/4ead2ine#&; } static void fun#parasint $% b & { inti; for #i ' 5; iV') ; i& { 1onsole/Write2ine#1onvert/Bo1har#b$i%&&; } } ,8 0 8( ,5 ( ) ) ( ,5 8( 0 ,8 1=4P P4=1 Which of these ethod of class =tring is used to checK whether a given string starts with a particular subst DndsWith#&
=tarts#& =tartsWith#& Dnds#& 1hoose correct stateent about the 1E/FDB code given below? enucolor:byte { yellow ' 5))green ' +)))pinK ' +0)) } bytes value cannot be assigned to enu eleents s valid range of byte exceeded the copiler will report an error enu eleents should always taKe successive values enu ust always be of int type Please read the Auestions carefully and choose the ost appropriate option/Which of the given options are +/=tring literals can contain any character literal including escape seAuences/ (/ttepting to access a character that is outside the bounds of the string results in an >ndexutf4angeD @oth + and ( only ( only + Fone of the listed options hat will be the output for given set of code ? static void "ain#string$% args& { object$% a ' {3+3- */)f- 3harsh3}; fun#a&; 1onsole/4ead2ine#&; } static void fun#paras object$% b& { for #inti ' ); iXb/2ength +; i..& 1onsole/Write2ine#b$i% . 3 3&; } + */) harsh +
* harsh + * hars + * What will be the output of set of code? static void "ain#string$% args& { int $% a ' {+- (- 0- *- 5}; fun#a&; 1onsole/4ead2ine#&; } static void fun#parasint$% b & { int$% K ' { 0- *- 8- -J])J }; for #inti ' ); iXb/2ength; i..& { b$i% ' b$i% . K$i% ; 1onsole/Write2ine# b$i% . 3 3&; } } *- ,- +)- +(- 5 0- *- 8- - 5 1opile tie error 0- *- 8- - 5- +- (- 0- *- 5 1orrect output for the 1E/FDB code given below is?
enum letters { a' b' c #
static void Main(string[] args) { letters l; l = letters!a; onsole!WriteLine(l); onsole!"eadLine(); #
) a + letters/a
Please read the Auestions carefully and choose the ost appropriate option/Which of the given options are B4CD? +/ variable cannot be assigned to an enu eleent/ (/n enuerator contains white space in its nae/ only + Fone of the listed options only ( @oth + and ( Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar +/n iplicit cast is needed to convert fro enu type to an integral type/ (/nenu variable cannot have a public access odifier/ only + only ( Fone of the listed options @oth + and (
DEBG >f debug point is on a ethodcall-777777will execute the entire ethod at a tie and stops at the nextlin
=teput @reaK =tep over =tep >n hat is the shortcut Key that is used to =tart or resue execution of your code and then halts execution wh
1trlI5
1trlI6 1trlI+) 1trl=hiftI5 What is the shortcut Key that is used to execute reaining lines out fro procedure?
=hiftI5 =hiftI++ I++ I5 What is the shortcut Key that is used to set the execution point to the line of code you choose
1trl=hiftI5 1trlI5 1trlI+) 1trl=hiftI+) What is the shortcut Key that is used to execute the next line of code but doesnot step into any function c session?
=hiftI6 =hiftI+) =hiftI5 =hiftI++ What is the shortcut Key that is used to set or reoves breaKpoint at the current line?
I5 I, I+) I6
What is the shortcut Key that is used to allow you to attach or detach the debugger to one or ore runnin
1trllt 1trlltP 1trlltW 1trlltL What is the shortcut Key that is used to run the code without invoKing debugger?
I6 I+) 1trlI5 I5 What is the shortcut Key that is used to display the threads window to view all of the threads for the current process?
1trlltP 1trlltL 1trlltW 1trllt
what are the commands that are not available in brea7 mode to proceed for further debugging
=tep>n =teput 1ontinue @reaK
GA>BAGE CL==EC:ILNS
What will be the output of following snippet of code? class nuber { int length ' 5); public int nuber+ { get { return length; } set { length ' value; } } } class Progra { public static void "ain#string$% args& { nuber p ' new nuber#&; p/nuber+ ' p/nuber+ . *); int K ' p/nuber+ 9 0 < 6; 1onsole/Write2ine#K&; 1onsole/4ead2ine#&; } }
0) ) +) 1opile tie error =elect the output for following set of 1ode : static void "ain#string$% args& { int a ' 5- b ' +); if #1onvert/Bo@oolean#1onvert/Bo>nt0(#)x@&&& if #1onvert/Bo@oolean#1onvert/Bo>nt0(#)((&&& if #1onvert/Bo@oolean#1onvert/Bo>nt0(#J]xebJ&&& 1onsole/Write2ine#3java3&; else ; else ; else ; }
java 1opile tie error: Cndefined sybol 1opile tie error: "isplaced else Warning: 1ondition is always true =elect output for set of code : static void "ain#string$% args& { int $%a ' { +- (- 0- *- 5- ,- 8- - 6- +)}; func#ref a&; 1onsole/4ead2ine#&; } static void func#ref int$% x& { 1onsole/Write2ine#3 nubers are:3&; for #inti ' ); iXx/2ength; i..& { if #x$i% Y ( '' )& { x$i% ' x$i% . +; 1onsole/Write2ine#x$i%&; } } }
nubers are : 0 5 8 6 ++ Fone of the entioned nubers are : ( 0 * 5 , nubers are : ( * , +) =elect the output for following set of code : static void "ain#string$% args& { int x ' ; int b ' +,; int 1 ' ,*; x <' b <' 1; 1onsole/Write2ine#x . 3 3 . b. 3 3 .1&; 1onsole/4ead2ine#&; }
( 0( 4un tie error 0( * 0( ( =elect correct output for following set of code/ static void "ain#string$% args& { int S ' ); if #1onvert/Bo@oolean#S ' )&& 1onsole/Write2ine#3>t is zero3&; else 1onsole/Write2ine#3>t is not zero3&; 1onsole/4ead2ine#&; }
Fone of the entioned >t is not zero >t is zero >nfinite loop =elect the relevant Mif stateentN to be placed in following set of code : static void "ain#string$% args& { int $%nu ' {5)- ,5- 5,- - *0- 5(}; int even ' )- odd ' ); for #inti ' ) ;iXnu/2ength ;i..& { <97777777777777777777777777779< } 1onsole/Write2ine#3Dven Fubers:3 .even&; 1onsole/Write2ine#3dd Fubers:3 .odd&; 1onsole/4ead2ine#&; }
if ##nu Y (& '' )& { even .' +; }
else { odd .' +; } if#nu$i% Y ( '' )& { even .' +; } else { odd .' +; } if##nu 9 i& '' )& { even .' +; } else { odd .' +; } if#nu$i% Y ( ' )& { even .' +; } else { odd .' +; } =elect the ouput for following set of code : static void "ain#string$% args& { int x ' * -b ' (;
x ' b<' x 9 b; 1onsole/Write2ine#x . 3 3 . b&; 1onsole/4ead2ine#&; }
*) )* *( Fone of entioned
Select the output for following set of code : static void "ain(string#$ args) { inti, j; for (i = &; iE= 4; iFF) { for (j = 4; j >= &; j**) { if (i == j) { 'onsole.riteine(+%+); else { 'onsole.riteine(+4+); 'onsole.riteine(+@n+); 'onsole.eadine();
)+) +)) ))+ +)) )+) ))+ +)) ))+
)+) ))+ )+) +)) Please read the Auestions carefully and choose the ost appropriate option/ Which of the following jobs are FB perfored by Harbage 1ollector? ll the listed options 1losing unclosed database collections/ Ireeing eory on the stacK/ 1losing unclosed files/
hat will be the output of following snippet of code3 class number { private int num% = ?4; private int num& = &4; public intanumber { get { return num%; set { num% = value; public int anumber% { get { return num&; set { num& = value; class !rogram { public static void "ain(string#$ args) {
number p = new number(); number 7 = new number(); int m = p.anumber; int t = 7.anumber%; int r = p.anumber < 7.anumber%; 'onsole.riteine(+sum = + * r); 'onsole.eadine();
su ' ) su ' +() 1opile tie error su ' +()) Please read the Auestions carefully and choose the ost appropriate option/>agine the scenario below/ n pushing a button an object is to be notified- but it is not Known until runtie which object should be n Which of the given prograing constructs should be used to ipleent this idea?
Faespace >nterface Lelegate ttribute =elect the output for following set of 1ode : static void "ain#string$% args& { int a ' +; int b ' +; if #1onvert/Bo@oolean #..a ' ..b&& 1onsole/Write2ine#3a3&; else 1onsole/Write2ine#3b3&; 1onsole/4ead2ine#&; }
b a copile tie error 1ode execute successfully with no output
What will be the output of following snippet of code? class nuber { int length ' ,); public int nuber+ { get { return length; } } } class Progra { public static void "ain#string$% args& { nuber p ' new nuber#&; int l; l ' p/nuber+ . *); int K ' l 9 0 < *; 1onsole/Write2ine#K&; 1onsole/4ead2ine#&; } }
What is the ethod to load assebly by nae ssebly/loadfile#& ssebly/reflectiononlyload ssebly/load fro#& ssebly/load#& What will be the output of following snippet of code? class nuber { private int nu+; private int nu(; public intanuber
{ get { return nu+; } set { nu+ ' value; } } public int anuber+ { get { return nu(; } set { nu( ' value; } } } class Progra { public static void "ain#string$% args& { nuber p ' new nuber#&; p/anuber ' (); nuber K ' new nuber#&; K/anuber+ ' *); int ' p/anuber; int t ' K/anuber+; int r ' p/anuber . K/anuber+; 1onsole/Write2ine#3nuber ' 3 .&; 1onsole/Write2ine#3nuber ' 3 .t&; 1onsole/Write2ine#3su ' 3 .r&; 1onsole/4ead2ine#&; } } Fone su ' ,) nuber ' *) nuber ' () nuber ' () nuber ' *) su ' ,)
1opile tie error
=in@ ssue ( coluns naed as Product and 1ategory how can be both sorted out based on first by categor
var sortedProds ' 7db/Products/rderby#c 'V c/1ategory& . Bhen@y#n 'V n/Fae& var sortedProds ' 7db/Products/rderby#c 'V c/1ategory& ll of the entioned var sortedProds ' 7db/Products/rderby#c 'V c/1ategory& / Bhen@y#n 'V n/Fae& Ior the given set of code what is output representing? class Progra { static void "ain#string$% args& { int$% nus ' { +- (- 0- )- *- 5 }; var posFus ' fro n in nus where n V ) select n; int len ' posFus/1ount#&; 1onsole/Write2ine#len&; 1onsole/4ead2ine#&; } }
Dxecution of code with counting total nubers greater than zero Dxecution of code with nothing being printed Dxecution of code with printing all nubers 4un tie error What will be the output of given code snippet? class Progra { static void "ain#string$% args& { int$% nus ' { +- (- 0- )- *- 5}; var posFus ' fro n in nus where n V' )
select n; foreach #int i in posFus& 1onsole/Write#i . 3 3&; 1onsole/Write2ine#&; 1onsole/4ead2ine#&;
} }
+- 0- )- 5 )- +- (- *- 5 +- 0- 5 4un tie error
1hoose the naespace in which Dxpression trees are encapsulated:
=yste/2inA =yste/Bext =yste/2inA/Dxpressions =yste/1ollections/Heneric
Ior the given set of code which Auery will worK according to the set of code? class Progra { static void "ain#string$% args& { int$% nus ' { +- (- 0- )- *- 5 }; int len ' <977777777777777777 9< 1onsole/Write2ine#3Bhe nuber of positive values in nus: 3 . len&; 1onsole/4ead2ine#&; } }
fro n in nus where n V ) select n #fro n in nus where n V ) select n&/1ount#&;
fro n in nus where n V ) select n/1ount#& ll of the entioned
Gor the given set of code what is output3 class !rogram { static void "ain(string#$ args) { int#$ nums = { %, F&, , 4, F, 5 ; var pos0ums = nums.here(n =E n > %4).Select(r =E rA); 'onsole.rite(+2he values in nums: +); foreach (int i in pos0ums) 'onsole.rite(i * + +); 'onsole.riteine(); 'onsole.eadine();
1opile tie error ( + ) ) ( + 4un tie error + ( ) ) + ( 1hoose the naespace in which the interface >Dnuerable is declared? @/ =yste/1ollections/Heneric 1/ @oth and @ L/ Fone of the entioned / =yste/1ollections =elect the output for given code snippet: class Progra { static void "ain#string$% args& { int$% nus ' { +- (- 0- )- *- 5 }; var posFus ' fro n in nus where n V 5 OO n X , orderby n descending
select n; 1onsole/Write#3Lescending order in nus: 3&; foreach #int i in posFus& 1onsole/Write#i . 3 3&; 1onsole/Write2ine#&; 1onsole/4ead2ine#&; } } Print nothing code run successfully 4un tie error 1opile tie error rranged in descending order code run successfully
Select the namespace which should be included while ma7ing use of 0H operations
=yste/1ollections/Heneric Fone of the entioned =yste/Bext =yste/2inA
Ior the given set of code what is output? class Progra { static void "ain#string$% args& { int$% nus ' { +- (- 0- 5 }; var posFus ' fro n in nus orderby n descending select n9* < (; 1onsole/Write#3Bhe values in nus: 3&; foreach #int i in posFus& 1onsole/Write#i . 3 3&; 1onsole/Write2ine#&; 1onsole/4ead2ine#&;
} }
+) ( * ,
5 + ( 0 4un tie error + 5 ( 0
Lpps 1Z What is output following set of code ? using =yste; public class @ase1lass { public @ase1lass#& { 1onsole/Write2ine#3> a a base class3&; } } public class 1hild1lass : @ase1lass { public 1hild1lass#& { 1onsole/Write2ine #3> a a child class3&; } static void "ain#& { 1hild1lass 11 ' new 1hild1lass#&; } }
Fone of the entioned > a a child class > a a base class > a a base class > a a child class copile tie error Please read the Auestions carefully and choose the ost appropriate option/Which of the given stateent
n interface can contain properties- ethods and events/ Dnhanced ipleentations of an interface can be developed without breaKing existing code/ ll the listed options >nterfaces can be ipleented by a class or a struct/
Please read the Auestions carefully and choose the ost appropriate option/Which of the given stateent
class that ipleents an interface can explicitly ipleent ebers of that interface n interface can be ipleented by ultiple classes in the sae progra/ ne interface can be ipleented in another interface Bhe functions declared in an interface have a body please read the Auestions carefully and choose the ost appropriate option/Which of the given stateent
>nterfaces cannot be inherited ll the listed options Properties can be declared inside an interface Iro two base interfaces a new interface cannot be inherited/
Please read the Auestions carefully and choose the ost appropriate option/Which of the given stateent +/ne class can ipleent only one interface/ (/>n a progra if one class ipleents an interface then no other class in the sae progra can iple nly + Fone of the listed options nly ( @oth + and ( 1orrect stateent about following 1E/FDB code is? class baseclass { int a; ublic baseclass(int a1) { a = a1; onsole!WriteLine(/a/); # class derivedclass 0 baseclass { ublic derivedclass(int a1) 0 base(a1) { onsole!WriteLine(/b/); #
# class rogram { static void Main(string[] args) { derivedclass d = ne derivedclass(%&); # # # utput : b a the progra will worK correctly if we replace base#a+& with base/baseclass#a+& utput : a b 1opile tie error =elect the output for given set of code? public class saple { public static int x ' +)); public static int y ' +5); } public class newspaper :saple { new public static int x ' +))); static void "ain#string$% args& { console/writeline#saple/x . 3 3 . saple/y . 3 3 . x&; } }
+)) +5) +)) +))) +5) +))) +)) +5) +))) +)) +5) +))) Please read the Auestions carefully and choose the ost appropriate option/ Which of the given stateents is B4CD about an interface used in 1E/FDB?
n interface can contain static data/
>f a class ipleents an interface partially- then it becoes an abstract class/ n interface can contain static ethods/ class cannot ipleent an interface partially/ Please read the Auestions carefully and choose the ost appropriate option/Which of the given stateent +/>nterfaces can contain only ethod declaration/ (/>nterfaces can contain static data and ethods/ only ( Fone of the listed options @oth + and ( only + Please read the Auestions carefully and choose the ost appropriate option/ >t is possible to create a custo attribute that can be applied only to specific prograing eleent#s& liKe which of the given options?
1lasses "ethods 1lasses- "ethods and "eber!ariables 1lasses and "ethods Please read the Auestions carefully and choose the ost appropriate option/Which of the given stateent +/ne class can ipleent only one interface/ (/>n a progra if one class ipleents an interface then no other class in the sae progra can iple nly ( Fone of the listed options @oth + and ( nly + Which stateent should be added in function a#& of class y to get output Qi love csharpR? class 2 { ublic void a() { onsole!WriteLine(/i love cshar/);
# # class + 0 2 { ublic void a() { 34 add statement here 43 onsole!Write(/b+e/); # # class rogram { static void Main(string[] args) { + ob5 = ne +(); ob5!a(); # # a#& x/a#&; x::a#&; base/a#&;
Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ca +/Dvents (/=tructures Fone of the listed options only ( @oth + and ( only + Please read the Auestions carefully and choose the ost appropriate option/Which of the given stateent
n interface cannot contain the signature of an indexer/ >nterfaces ebers are autoatically public/ When a class inherits an interface it inherits eber definitions as well as its ipleentations/ Bo ipleent an interface eber- the corresponding eber in the class ust be public as well
Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ca
+/Properties (/"ethod @oth + and ( Fone of the listed options only + only (
Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ca +/class (/enu @oth + and ( only + Fone of the listed options only ( =elect stateent added to the current set of code to get output as +) () ? class baseclass { protected int a ' (); } class derived : baseclass { int a ' +); public void ath#& { <9 add code here 9< } } 1onsole/Write2ine#a . R R . base/a&; 1onsole/Write2ine# ybase/a . R R . a&; 1onsole/Write2ine#base/a . R R . a&; 1onsole/Write2ine# a . R R . this/a&;
Lops 2 class consists of two interfaces with each interface consisting of three ethods/
Bhe class had no instance data which indicates correct size of object created fro this class?
+( bytes +, bytes ) bytes (* bytes Which of these stateents is incorrect? Bwo thread in 1sharp can have sae priority 1reating an instantiation for a thread doesnJt ean that thread has started its execution process @y ultithreading 1PCNs idle tie is iniized- and we can taKe axiu use of it thread can exist only in two states- running and blocKed Which of these class is used to aKe a thread?
=tring =yste 4unnable Bhread Bhe odifier used to define a class which does not have objects of itNs own but acts as a base class for itNs
abstract =tatic Few =ealed Hiven the class saple inherited by class saple +/ Which are correct stateents about construction of object of class saple? Bhe constructor of only saple class will be called While creating the object firstly the constructor of class saple will be called followed by constructor While creating the object firstly constructor of class saple + will be called followed by constructor o Bhe order of calling constructors depend on whether constructors in class saple and saple + are
=elect the class visibility odifiers aong the following :
Private- protected- public- internal Private- protected- public Private- protected- public- internal- protected internal ll of the entioned 1hoose the correct output of following given code snippet? interface i+ { void f+#&; } interface i( :i+ { void f(#&; } public class aths :i( { public void f(#& { 1onsole/Write2ine#3fun(3&; } public void f+#& { 1onsole/Write2ine#3fun+3&; } } class Progra { static void "ain#& { aths ' new aths#&; /f+#&; /f(#&; } } fun+ fun( fun( fun+ fun( fun+ 1hoose the correct stateent about following code snippet given below: interface a+ {
void f+#&; void f(#&; } class a :a+ { private int i; void a+/f+#& { } } 1opile tie error 1lass a could not have an instance data 1lass a is an abstract class 1lass a fully ipleents the interface a+ What is ultithreaded prograing?
>ts a process in which a single process can access inforation fro any sources >tNs a process in which two different processes run siultaneously >tNs a process in which two or ore parts of sae process run siultaneously >ts a process in which any different process are able to access sae inforation
Which of the folloing is the correct a+ of imlementing an interface addition b+ class maths? a) class maths 0 addition {# b) class maths imlements addition {# c) class maths imorts addition {# d) .one of the mentioned =elect the output for following set of codes: static void "ain#string$% args& { int i ' ); while #i.. [' )& ; 1onsole/Write2ine#i&; 1onsole/4ead2ine#&; }
>t is not necessary to declare size of an array with itNs type +(8 to .+(8
+ ) to +(8 class eber declared protected becoes eber of subclass of which type?
private eber public eber static eber protected eber =elect the output for following set of code: static void "ain#string$% args& { int i ' +- j ' +; while #..i X' +)& { j..; } 1onsole/Write2ine#i. 3 3 .j&; 1onsole/4ead2ine#&; } >t is not necessary to declare size of an array with itNs type ++ +) +( ++
Select the correct statement among the given statements3
>nterfaces cannot be inherited Properties could be declared inside an interface Fone of the entioned ne class could ipleent only one interface What will be the output of given code snippet? interface calc { void cal#int i&; }
class display :calc { public int x; public void cal#int i& { x ' i 9 i; } } class display@ :calc { public int x; public void cal#int i& { x ' i < i; } } class Progra { public static void "ain#string$% args& { display arr+ ' new display#&; display@ arr( ' new display@#&; arr+/x ' ); arr(/x ' ); arr+/cal#(&; arr(/cal#(&; 1onsole/Write2ine#arr+/x . 3 3 . arr(/x&; 1onsole/4ead2ine#&; } }
)) *+ +* ((
Lops 1orrect way to ipleent the interface given below? interface person { string firstnae { get;
set; } } class ep :person{ private string str; public string firstnae; { get { return str; } set { str ' value class ep :ipleents person { private string str; public string firstnae { get { return str; } set Fone of the entioned class ep: ipleents person { private string str; public string person/firstnae { get { return str; 1orrect code to be added for overloaded operator ^ for 1E /net code given below? class csharp { int x- y- z; public csharp#& { } public csharp#int a -int b -int c& { x ' a; y ' b; z ' c; } dd correct set of code here public void display#& { console/Write2ine#x . 3 3 . y . 3 3 . z&; } class progra { static void "ain#=tring$% args& { csharp s+ ' new csharp#5 -, -&; csharp s0 ' new csharp#&; s0 ' s+; s0/display#&; } } } public static csharp operator #csharp s+& { csharp t ' new csharp#&; t/x ' s+/x; t/y ' s+/y; t/z ' s public static csharp operator #csharp s+& { csharp t ' new csharp#&; t/x ' s+/x; t/y ' s+/y; t/z ' public static csharp operator #csharp s+& { csharp t ' new csharp#&; t/x ' s+/x; t/y ' s+/y; t/z ' Fone of the entioned
hat will be the output for set of code3 class maths { public int fun(int 7, int , int n) { 'onsole.riteine(7 * + + * * + + * n); return (7); public int fun%(intt,float I) { 'onsole.riteine(t * + + * I); return t; class !rogram { static void "ain(string#$ args) { mathsobj = new maths(); int b = C4; int c = %44; int d ; float l; inti = obj.fun(b, c, %&); int j = (obj.fun%(%&, %.JBf)); 'onsole.eadine();
6)- +))- +( +(- +* )- )- ) +(- +*/8 )- )- ) )- ) 6)- +))- +( +(- +*/8 What would be output for set of code? class aths { public int x; public double y; public int add#int a- int b& { x ' a . b; return x; } public int add#double c- double d& { y ' c . d; return #int&y; }
public aths#& { this/x ' ); this/y ' ); } } class Progra { static void "ain#string$% args& { athsobj ' new aths#&; int a ' *; double b ' 0/5; obj/add#a- a&; obj/add#b- b&; 1onsole/Write2ine#obj/x . 3 3 . obj/y&; 1onsole/4ead2ine#&; } } 8/5 ) 8 * 0/5 What will be the output of given code snippet? interface calc { void cal#inti&; } public class aths :calc { public int x; public void cal#inti& { x ' i 9 i; } } class Progra { public static void "ain#string$% args& { athsarr ' new aths#&; arr/x ' ); arr/cal#(&; 1onsole/Write2ine#arr/x&; 1onsole/4ead2ine#&; } }
) ( * Fone of the entioned What could be the output of following set of code? class Progra { static void "ain#string$% args& { 1onsole/Write2ine# vol#+)&&; 1onsole/Write2ine# vol#(/5f- 5&&; 1onsole/Write2ine# vol# 5l- *- 5&&; 1onsole/4ead2ine#&; } static intvol#int x& { return#x 9 x 9 x&; } static float vol#float r- int h& { return#0/+*f 9 r 9 r 9 h&; } static long vol#long l- int b- int h& { return#l 9 b 9 h&; } }
+))) ) +)) ) ) +)) copile tie error +))) 6/+(5 +)) What will be the output for given set of code? class aths { public int fun#int ii& { return#ii V ) ? ii :ii 9 +&; } public long fun#long ll& { return#llV ) ? ll :ll 9 +&; }
public double fun# double dd& { return#ddV ) ? dd :dd 9 +&; } } class Progra { static void "ain#string$% args& { athsobj ' new aths#&; inti ' (5; int j ; long l ' +)))))l ; long ; double d ' +(/0*; double e; j ' obj/fun#i&; ' obj/fun#l&; e ' obj/fun#d&; 1onsole/Write2ine#j 1onsole/Wr ite2ine#j . 3 3 . . 3 3 . e&; 1onsole/4ead2ine#&; } }
))) +++ ) (5 +))))) +(/0* =elect the correct ipleentation of the interface which is entioned below/ interface a+ { int fun#inti&; }
Fone of the entioned class a: ipleents a+ { int fun#inti& { } } class a { int fun#inti& as a+/fun { } } class a: a+ { int a+/fun#inti& { } } =elect output for set of code? class saple {
public inti; void display#& { 1onsole/Write2ine#i&; } } class saple+ : saple { public int j; public void display#& { 1onsole/Write2ine#j&; } } class Progra { static void "ain#string$% args& { saple+ obj ' new saple+#&; obj/i ' +; obj/j ' (; obj/display#&; 1onsole/4ead2ine#&; } }
+ ( 0 1opile Bie Drror Bhe following set of code run on single level of inheritance/ Iind correct stateent about the code? class saple { inti ' +); int j ' (); public void display#& { 1onsole/Write2ine#3base 1onsole/Wr ite2ine#3base ethod 3&; } } class saple+ : saple { public int s ' 0); } class Progra { static void "ain#string$% args&
{ saple+ obj ' new saple+#&; 1onsole/Write2ine#3{)}1onsole/Wr ite2ine#3{)}- {+}- {(}3- obj/i- obj/j- obj/s&; obj/display#&; 1onsole/4ead2ine#&; } }
copile tie error base ethod +)- ()- 0) base ethod +)- ()- )
Lops concept + Which of these can be used to fully abstract a class fro its ipleentation?
PacKages bjects Fone of the "entioned >nterfaces ccess specifiers which can be used for an interface?
Private ll of the entioned Protected Public Loes 1E/FDB supports partial ipleentation of interfaces?
true 1anNt =ay false
Fone of the entioned Which of following Keyword used to change data and behaviour of a base class by replacing a eber of new derived eber?
verrides new @ase verloads Which Keyword used for correct ipleentation of an interface in 1E/FDB?
intf >nterface >ntf interface 1orrect stateent about 1E code is? public class aths { public int x; public virtual void a#& { } } public class subject : aths { new public void a#& { } }
subject class hides a#& ethod of base class Bhe code replaces the subject class version of a#& with itNs ath class version Bhe subject class version of a#& ethod gets called using saple class reference which holds subje
Fone of the entioned Which ethod is called when a thread is blocKed fro running teporarily?
ll of the entioned Pulse#& Pulsell#& Wait#& Which of these Keywords are used to ipleent synchronization?
synchronized synchronize synch syn Which stateent correctly defines about >nterfaces in 1E/FDB?
>nterfaces consists of only ethod declaration >nterfaces cannot be inherited Fone of the entioned >nterfaces consists of data static in nature and static ethods 1hoose the correct stateents aong the following:
n abstract ethod does not have ipleentation n abstract ethod can taKe only either static or virtual odifiers n abstract ethod can be declared only in abstract class ll of the entioned
Lops concept Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar
1E does not support ultiple inheritance in case of classes- but interfaces do support ultiple inh >n an interface all the ethods are abstract/ ll of the listed options ll interfaces should be declared with the Keyword interface/ Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar
Fone of the listed options "ultiple classes ay ipleent the sae interface- and a single class ay ipleent one or or >nterfaces are essentially definitions of how a class needs to respond/ >n interface at least one ethod should not be abstract/
Please read the Auestions carefully and choose the ost appropriate option/>s it possible to ipleent a
Tes- but you should provide signatures of all ethods- in the derived class Fo- there is a liit to the nuber of interfaces you can ipleent in a single derived class Tes- and you ay or ay not provide signature of all ethods- in the derived class
Cntil the call of which type of ethod the newly created thread will not start executing? Few#& =tart#& ll the given options @egin#&
Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar
We can use virtual ethod to provide default ethod ipleentation @oth the listed options Fone of the ( listed options We can use override Keyword to change the ipleentation of the virtual ethods in the sub clas Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar
1hild class instance cannot access the base class ethods 1hild class instance can access the base class ethods Please read the Auestions carefully and choose the ost appropriate option/4ead the below stateent car =tateent +: n interface in 1E is a pure abstract class =tateent (: n interface contains only definition of events- indexers- ethods and
nterfaces3?
@oth stateents are true nly =tateent ( is true nly =tateent + is true Fo =tateent is true Please read the Auestions carefully and choose the ost appropriate option// Which of the given options is B4CD about 3>nterfaces3? 1lasses and structs inheriting interfaces ust provide an ipleentation for each interface eber 1lasses and structs inheriting interfaces- ay or ay not provide an ipleentation for each interf Please read the Auestions carefully and choose the ost appropriate option/>nheritance enables you to cr are defined in other classes?
4euse- Dxtend and "odify nly Dxtend and "odify nly 4euse nly "odify
!lease read the -uestions carefull and choose the most appropriate option.f ou add a new method to an nterface, then which of the
Tou have the option of providing default ipleentation and therefore all the existing code ight w Tou have to tracK down all the ipleentations of the interface and define ipleentation for the n Fone of the ( listed options
hich statement correctl defines about nterfaces in 'K.0623
Fone
>nterfaces consists of data static in nature and static ethods >nterfaces consists of only ethod declaration >nterfaces cannot be inherited Please read the Auestions carefully and choose the ost appropriate option/Which of the given options are +/Bhe subclass inherits all the super class attributes and extends the or adds others/ (/1 =harp supports ultiple inheritance only ( @oth + and ( only + Fone of the listed options Please read the Auestions carefully and choose the ost appropriate option/4ead the below stateents car =tateent +: >nterface reAuires ore tie to find the actual ethod in the corresponding classes where a =tateent (: bstract ethod declarations are only peritted in abstract classes/ Which of the above stateents are B4CD? nly =tateent ( is true @oth stateents are true Fo =tateent is true nly =tateent + is true
'hoose the correct statement about following code snippet in 'K.062: interface abc { String Girst0ame { get; set; String ast0ame { get; set; void print(); void stoc7(); int fun();
Properties cannot be declared inside an interface Fone of the entioned Iunctions should be declared inside an interface
>t is worKable code Cntil the call of which type of ethod the newly created thread will not start executing? Few#& @egin#& ll the given options =tart#& 1hoose the naespace which supports the ultithreading prograing: ll of the entioned =yste/net =yste/2inA =yste/Bhreading
Lops concept / Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar
@oth the override ethod and the virtual ethod ust have the sae access level odifier/ n abstract ethod is iplicitly a virtual ethod/ Bhe overridden base ethod ust be virtual- abstract or override/ ll the listed options
!lease read the -uestions carefull and choose the most appropriate option.hich of the given options is 2D63
When overriding a ethod- the naes and type signatures of the override ethod ust be the sae Fone of the ( listed options bstract ethods are iplicitly virtual/ @oth the listed options What will be the output for given set of code? class { public virtual void display#& { 1onsole/Write2ine#33&; } }
class @: { public override void display#& { 1onsole/Write2ine#3@3&; } } class Progra { static void "ain#string$% args& { obj+ ' new #&; @ obj( ' new @#&; r; r ' obj+; r/display#&; r ' obj(; r/display#&; 1onsole/4ead2ine#&; } } @ 1opile tie error @ @ Please read the Auestions carefully and choose the ost appropriate option/Which of the given options is B4CD? Fone of the ( listed options @oth the listed options When used as a odifier- the new Keyword explicitly hides a eber inherited fro a base class/ perator overloading worKs in different ways for structures and classes/ Please read the Auestions carefully and choose the ost appropriate option/Which of the given options is
@y default ethods are virtual Fone of the ( listed options >f a derived class does not provide its own version of virtual ethod then the one in the base class @oth the listed options
What will be the output for set of code? static void "ain#string$% args& { inti ' 5; int j ' ,; add#ref i&; add#,&; 1onsole/Write2ine#i&; 1onsole/4ead2ine#&; } static void add#ref int x& { x ' x 9 x; } static void add#int x& { 1onsole/Write2ine#x 9 x 9 x&; }
(5 ) (+, ) 1opile tie error (+, (5 Please read the Auestions carefully and choose the ost appropriate option/>n which of the following shou ethods?
Fuber of arguents rder of arguents Bype of arguents ll the listed options Please read the Auestions carefully and choose the ost appropriate option/Which of the given options is
We can use the new odifier to odify a nested type if the nested type is hiding another type/ Fone of the ( listed options @oth the listed options perator overloading perits the use of sybols to represent coputations for a type/
Please read the Auestions carefully and choose the ost appropriate option/Which of the following Keywor functions?
operator ll the listed options op opoverload
!lease read the -uestions carefull and choose the most appropriate option.hich of the given options is 2D63
perator overloading worKs in different ways for structures and classes/ @oth the listed options
Fone of the ( listed options When used as a odifier- the new Keyword explicitly hides a eber inherited fro a base class/ Please read the Auestions carefully and choose the ost appropriate option/ derived class can stop virtu
not inheritable extends sealed inheritable
!lease read the -uestions carefull and choose the most appropriate option.hich of the given options is 2D63
Bhe conditional logical operators cannot be overloaded/ @oth the listed options Fone of the ( listed options When a binary operator is overloaded the corresponding assignent operator- if any- ust be expli Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ar
OO ll the listed options [ __ What will be the output for given set of code? class a { public void fun#& { 1onsole/Write2ine#3base ethod3&; } } class b: a { public new void fun#& { 1onsole/Write2ine#3derived ethod3&; } } class Progra { static void "ain#string$% args& { b K ' new b#&; K/fun#&; 1onsole/4ead2ine#&; } } 1opile tie error derived ethod base ethod 1ode run successfully print nothing What will be the output for given set of code? class aths { public int fun#int K- int y& { return K . y; } public int fun+#int t- float z& {
return #t.#int&z&; } } class Progra { static void "ain#string$% args& { athsobj ' new aths#&; inti; int b ' 6); int c ' +)); int d ' +(; float l ' +*/8f; i ' obj/fun#b- c&; 1onsole/Write2ine#i&; int j ' #obj/fun+#d- l&&; 1onsole/Write2ine#j&; 1onsole/4ead2ine#&; } }
+6)- ) +6)- (,/8f +6)- (, )- (,/8f What will be the output for given set of code? class a { public void fun#& { 1onsole/Write2ine#3base ethod3&; } } class b: a { public new void fun#& { 1onsole/Write2ine#3derived ethod3&; } } class Progra { static void "ain#string$% args& { b K ' new b#&; K/fun#&; 1onsole/4ead2ine#&;
} } derived ethod 1opile tie error base ethod 1ode run successfully print nothing Please read the Auestions carefully and choose the ost appropriate option/Which of the given options ca
Dvents "ethods Properties ll the listed options Please read the Auestions carefully and choose the ost appropriate option/Which of the given options is
@oth the listed options @y default ethods are virtual/ Fone of the ( listed options Dach derived class does not have its own version of a virtual ethod/ What could be the output for set of code? class overload { public int x; int y; public int add#int a& { x ' a . +; return x; } public int add#int a- int b& { x ' a . (; return x; } } class Progra {
static void "ain#string$% args& { overload obj ' new overload#&; overload obj+ ' new overload#&; int a ' ); obj/add#,&; obj+/add#,- (&; 1onsole/Write2ine#obj/x&; 1onsole/Write2ine#obj+/x&; 1onsole/4ead2ine#&; } }
+) 8 )( Please read the Auestions carefully and choose the ost appropriate option/Which of the given options is
Fone of the ( listed options We can use the new odifier to odify a nested type if the nested type is hiding another type/ perator overloading perits the use of sybols to represent coputations for a type/ @oth the listed options Please read the Auestions carefully and choose the ost appropriate option/Which of the given options is
Fone of the ( listed options @oth the listed options bstract ethods are iplicitly virtual/ When overriding a ethod- the naes and type signatures of the override ethod ust be the sa
#roperties choose the correct stateent about properties describing the indexers?
n indexer property should accept at least one arguent Fo need to use the nae of the property while using an indexed property >ndexers can be overloaded ll of the entioned 1orrect way to ipleent a write only property add in a ath class?
Fone class ath { public int add { set { add ' value; } } } class ath { int ad; public int add { get { return ad; } set { ad ' value; } }
} class ath { int ad; public int add { set { ad ' value; } } } =elect the odifiers which can be used with the properties? ll the given options Protected >nternal Private Public Protected 1hoose the correct stateents about writeonly properties in 1E/FDB? Properties which can only be set ll of the listed options Properties once set and hence values cannot be read bacK in nature Cseful for usage in classes which store sensitive inforation liKe password of a user 1onsider a class aths and we had a property called as su/b is a reference to a aths object and we want the stateent 1onsole/Write2ine#b/su&to fail/ Which is the correct solution to ensure this functionality? Leclare su property with only get accessor Leclare su property with get- set and noral accessors Leclare su property with both get and set accessors
Leclare su property with only set accessor 1orrect way to ipleent a read only property add in a ath class?
Fone class ath { public int add { get { return ad; } } } class ath { int ad; public int add { get { return ad; } set { ad ' value; } } } class ath {
int ad; public int add { get { return ad; } }
} 1onsider a class aths and we had a property called as su/b is a reference to a aths object and we w functionality? b/aths ' +); 1onsole/Write2ine#b/aths&;
Leclare aths property with only set accessors Leclare aths property with only get- set and noral accessors Leclare aths property with only get accessors Leclare aths property with get and set accessors >f ath class had add property with get accessors then which stateents will worK correctly? ath ' new ath#&; inti; i ' /add; ath/add ' (); ath ' new ath#&; /add ' /add . (); ath ' new ath#&; /add ' +);
Please read the Auestions carefully and choose the ost appropriate option/ property can be declared in
false true
property can be declared inside a naespace or a procedure/
[A].
Brue
[B].
Ialse
>e[ections Which one of the following is an exaple of serialization ll the given options =P =ession Latabase LisKfile Which objects services ultiple clients and hence it share data by storing state inforation between clien =ingleton =ingle 1all "ultiton "ulti 1all What does the following code specifies? object >nvoKe#object obj- object$% paraeters& 1alling a type using invoKe#& ny arguents that need to be passed to the ethod are specified in the array paraeters ll the given options Bhe value returned by the invoKed ethod is returned by >nvoKe#&
Bhe property signifies Qbtains a "odule object that represents the odule #an executable file& in which t specifies the following stateent:
int "etadataBoKen Bype LeclaringBype Bype 4eflectedBype "odule "odule 1hoose the naespace which consists of classes that are part of /FDB 4eflection P>:
Fone =yste/Fae =yste/Bext =yste/4eflection ow any types of serialization that are coonly used ?
What does the following ethod specifies? Bype$% HetHenericrguents#& btains a list of the type arguents bound to a closed constructed generic type ll the given options the list ay contain both type arguents and type paraeters a property defined by "eber>nfo Le=erialization is the process of converting 77777777 in to 7777777
object to byte byte to array
object to array byte to object
Which one of the following is not an advantage of S"2 =erialization? Hreater >nteroperability "ore dinistrator Iriendly ll the given options @etter @acKward 1opatibility @etter Iorward 1opatability
Which =erialization is used for counicating between application that uses heterogeneous architectures =oap =erialization ll the given options S"2 =erialization @inary =erialization
\ml With S"2: views are not liited to one ultivalued path only database data can autoatically be extracted fro S"2 docuents only/ ll the given options docuents can autoatically be generated fro database data only/