Mle Coia Qoestier of these is a wrapper fors
Q.9.
Which
?
mple
amongst the following:
char
Tck () the only correct data type
(b) Character
(a) Float
Q.1. In Java, a library of classes
is called . () Integer
(b) a package (c) String
(a) a folder
(d) an application Ans. (b) of the follow
c) a directory will be the output
Ans. (b)
Q.10. What ing
program?
Integer is a . . .
Q.2. inner class class Output{
(a) adapter class (6)
public static void
main (String args
(c) not a class )wrapper class
Integer i
= new Integer(150);
Ans. (d) double x = [Link]);
of a class
Which of the following may be part
Q.3. [Link](x);
definition?
(b) instance methods
(a) instance variables
(c) constructors (d) All of these
(b) 1
(e) None of these (a) 150
(d) 150.0
Ans. (d) (c)0
instance of a
object is an Ans. (d)
. . . . . . . .
Q.4. An
(b) class the following classes is not included
(a) program Q.11. Which of
(c) method () data [Link]?
(a) Class b) Integer
Ans. (b)
is required to (c) Byte () Array
Q.5. The keyword ......
declare a class. Ans. (d)
(b) private Q.12. Each primitive
data type belongs to a
(a) public
(c) class (d) All of these specific:
(a) Block (b) Object
Ans. (c)
You want subclasses in any package to have (c) Wrapper Class (d) Sub class
Q.6.
access to members of a superclass. Whichis Ans. (c)
the most restrictive access that accomplishes Q.13. The valueOf0 function converts:
this objective? (a) Primitive type to String
(a) public ) private b) String to primitive type
(d) transient (c) Integer to Float
(c) protected
Ans. (c) (d) Character to String
Which of these is a wrapper for data type Ans. (b)
Q.7.
int ? Q.14. What will be the output of following
(6) Long program ?
(a) Integer
(e) Byte ( Both (a) and (b) above public class Test{
Ans. (a) public static void main(String args[ ){
Q.8. Which of these is aprocess of convertinga charch '#"';
boolean b = [Link](ch
simple data type into a class ?
(a) type casting [Link](b);
(6) type conversion
(c) type wrapping
(d) None of the mentioned (a) 1 b) 0
Ans. (b) (c) -1 (d)false
Ans. (d)
10
[16) Evergreen Question ons
Bank in Computer Applicauo
o.15. What will be the output of
program ? following Q.18. What will be the output of the
following
public class Test { program?
publicclass Test
public static void main(String args[ ) { public static void main(String args[ D {
char ch 'm';
=
char ch = 'a';
char chr
int a (int)[Link](ch);
=
char chr =
[Link](ch);
chr; int n =
(int) chr + 20;
[Link](chr + "\t" +a); [Link]((char)n+"It" + chr);
(a) M 77 (b) 77 M
(c) N 76 (a)ua (6) a 20
(d) 76 N c) a + 20 (d) 87
Ans. (a) Ans.
What will be the output of the
(a)
Q.16. following Q.19. What will be the output of the following
programa?
program ?
publicclass Test{ public class Test {
public static void main(String args[ 1) { public static void main(String args[ ]) {
char chr =
'C'; String str = "Best questions";
int i = 4;
[Link]([Link]('s',' )3
[Link](chr + i);
[Link](int) chr + i);
(a) Be t que tion (6) Bet question
(c) Bess quession ()Best questions
(a) 70 (b) 71 Ans. (a)
(c) C+ 4 (d 4+ Cc Q.20. What will be the output of the following
Ans. (b) program ?
Q.17. What will be the output of the following public class Test {
program? public static void main(String args[ D)
public class Test { String str = "- Best questions";
public statie void main(String
int n = 111;
args[ ) String strl = "Best Answers";
[Link]([Link](str);
char ch = [Link]
(char)n);
[Link](ch + " My God!");
(a) Best Answers Best questions
(b) - Best Answers-Best questions
(c) - Best Answers Best questions
(a) Runtime error (b) Mt God! 111 ()Best Answers-Best questions
(c) 111 My God! () OMy God! Ans. (d)
Ans.