Q139 What is the output displayed by the following program?
; w6 v* H: W) i9 | class Question {
7 K1 V5 g9 f$ E. H; v public static void main (String[] args)9 M# u5 X9 ]9 X( K. p
{( K8 J: M8 [. U; m
String s1 = “ab”;
1 _; ^, z/ h. _" ` String s2 = “abcd”;
% ~" U% D2 G4 b( u0 j, a String s3 = “cd”
: k0 g2 [4 P" t+ S2 G5 U String s4 = s1 + s3;/ K/ O4 {5 W" {2 ?; w3 i
s1 = s4;( Q- c3 X" ?3 X2 v
System.out.print(“s1 “ + (( s1== s2) ?- M3 b& ^4 p# f
“==” : “!=”) + “ s2”);
" I) J! i2 s9 y/ Y9 E/ _0 B }" q% C% {1 w8 K; a2 e- i+ d
}
" V: N% h& J3 m: {, s) R A s1 == s2
( M# @" U; o) [8 E/ _; Y8 I J7 t B s1 != s2
2 E- i2 ?( |% z9 `, v4 R' z/ g C s1
1 h( |! ~ `8 e& }$ A& O D s1 == “abcd”! F: l3 Z, i, g) u( W$ T5 m
Q140 Which of the following are true about constructors?
, e1 M( a4 S. B4 r/ ^. p- P; P: ^ A A class inherits its constructors from its parent.' n/ M. e5 _7 Z
B The compiler supplies a default constructor if no constructors are
' C9 R( u+ C; h9 h9 W provided for a class.
1 u/ o5 A# s5 v2 U2 n, o C All constructors have a void return type.
# i# a* a2 z# `5 v/ q D A constructor may throw an exception.
. N: E" O. `6 m Q141 Which of the following are primitive types?
. G7 V& H2 r& n. c6 E) s$ Z A byte
: j# i7 C* l' u" ? B String4 R9 r# u% M8 u( x
C integer8 O) }$ P- s' i. W1 }
D Float5 U& Y* X; {5 u+ t u
Q139 B
1 [& y& C9 N+ S( d Q140 BD
7 |+ x3 h# i; R9 L6 s' F7 O Q141 A |