0% found this document useful (0 votes)
11 views

Java QB

Uploaded by

madhudhaya0
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Java QB

Uploaded by

madhudhaya0
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 40

1 2 B 3 11AO Basic runtime entities are called

0 D 3 BJ
2 C A _______.
3
A B
Classes objects
. .
C D
properties function
. .
Answer is : B
2 2 B 3 11AO Original name of Java is ____
0 D 3 BJ
2 C A
3
A B
JavaOO JavaC++
. .
C D
Oak none
. .
Answer is : C
3 2 B 3 11AO Java was developed in the year
0 D 3 BJ
2 C A ____
3
A B
1995 2000
. .
C D
2001 2008
. .
Answer is : A
4 2 B 3 11AO Java was developed at _____
0 D 3 BJ
2 C A
3
A Bsun
microsoft
. . microsystem
C D
oracle TCS
. .
Answer is : B
5 2 B 3 11AO Expand J2SE
0 D 3 BJ
2 C A
3
Java 2 Java 2
A B
Standard Software
. .
Edition Edition
CJava 2 System D
none
. Edition .
Answer is : A
6 2 B 3 11AO Expand JDK
0 D 3 BJ
2 C A
3
Java Java
A B
Deployment Development
. .
Kit Kit
C D
Java design none
. .
Answer is : B
7 2 B 3 11AO Java platform independence is
0 D 3 BJ
2 C A achieved through ____
3
A B
JDK J2SE
. .
C D
JVM none
. .
Answer is : C
8 2 B 3 11AO JVM stands for
0 D 3 BJ
2 C A
3
AJava Virtual BJava Visual
. Mechanism . Machine
CJava Virtual DJava Visual
. Machine . Mechanism
Answer is : C
9 2 B 3 11AO Which one of the following is
0 D 3 BJ
2 C A not supported by java?
3
A B
pointers file
. .
C D
inheritance static constant
. .
Answer is : A
1 2 B 3 11AO In public static void main(String
0 0 D 3 BJ
2 C A args[]) –args specifies
3
Acommand line Bstring
. argument . arguments
C D
string array none
. .
Answer is : A
1 2 B 3 11AO What is different between a Java
1 0 D 3 BJ
2 C A applet and a Java application?
3
An application An applet
can in general must be
A B
be trusted executed in a
. .
whereas an browser
applet can't environment
CAn applet is not Dall of the
. able to access . above
the files of the
computer it runs
on
Answer is : D
1 2 B 3 11AO What is byte code in the context
2 0 D 3 BJ
2 C A of Java?
3
The type of
The type of
code
A Bcode generated
generated by
. . by a Java
a Java
Virtual Machine
compiler
It is the code
It is another
written within
Cname for a D
the instance
. Java source .
methods of a
file
class.
Answer is : A
1 2 B 3 11AO Which of the following
3 0 D 3 BJ
2 C A declarations is correct?
3
Aboolean b = B
byte b = 255
. TRUE .
CString s = D
both a and b
. “CMS”; .
Answer is : C
1 2 B 3 11AO Declarations can appear
4 0 D 3 BJ
2 C A anywhere in the body of a Java
3 method before it is used
A B
true false
. .
C D
may be none
. .
Answer is : A
1 2 B 3 11AO The range of values for the long
5 0 D 3 BJ
2 C A type data is
3
A 31 B 64
-2 to 231-1 -2 to 264
. .
C 63 D 32
-2 to 263-1 -2 to 232-1
. .
Answer is : C
1 2 B 3 11AO What is the main purpose of
6 0 D 3 BJ
2 C A the 'public static void
3 main(String[] args)' method
in a Java program?
A It is the entry B It is used to
point of the
program where declare
. .
execution variables.
begins.
It is
It is used for
Cresponsible for D
defining
. printing output .
classes.
to the console.
Answer is : C
1 2 B 3 11AO Which of the following
7 0 D 3 BJ
2 C A assignments are valid?
3
A B
float x=123.4 int num;
. .
C int n=(int) D
none
. false .
Answer is : B
1 2 B 3 11AO The default value of char type
8 0 D 3 BJ
2 C A variable is ___
3
A B
‘\u0020’ ‘\u00ff
. .
C D
““ ‘\u0000’
. .
Answer is : D
1 2 B 3 11AO What will be the result of the
9 0 D 3 BJ
2 C A expression 13 & 25?
3
A B
125 25
. .
C D
9 12
. .
Answer is : C
2 2 B 3 11AO Which of the following is not a
0 0 D 3 BJ
2 C A primitive type?
3
A B
byte string
. .
C D
integer float
. .
Answer is : B
2 2 B 3 11AO What is the result of the
1 0 D 3 BJ
2 C A expression ?
3
(1&2) + (3|4)
A1 B2
. .
C D
8 7
. .
Answer is : D
2 2 B 3 11AO In Java, what is the default value
2 0 D 3 BJ
2 C A for an instance variable (non-
3 static variable) of type int?
A B
0 1
. .
C D
null undefined
. .
Answer is : A
2 2 B 3 11AO What is the role of the static
3 0 D 3 BJ
2 C A keyword in Java?
3
It is used to
It indicates that
A Bcreate dyna
a method cannot
. . mic
be overridden
variables
It indicates that
a variable or
method belongs It is used to
C D
to the class rather define cons
. .
than an tant values
instance of the
class
Answer is : C
2 2 B 3 11AO Which of the following
4 0 D 3 BJ
2 C A expressions are illegal?
3
A B (false &&
(10 | 5)
. . true)
Boolean
C D
x=(Boolean) both b and c
. .
10;
Answer is : D
2 2 B 3 11AO Which of the following control
5 0 D 3 BJ
2 C A expressions are valid for an if
3 statement?
Aan integer Ba Boolean
. expression . expression
C D
either a or b neither a nor b
. .
Answer is : B
2 2 B 3 11AO Which of the following is a
6 0 D 3 BJ
2 C A decision making statement
3
A Bswitch
if statement
. . statement
Cconditional D
all the above
. statement .
Answer is : D
2 2 B 3 11AO What is the numerical range of a
7 0 D 3 BJ
2 C A char?
3
A B -(215) to (215)
-128 to 127
. .–1
C D
0 to 32767 0 to 65535
. .
Answer is : D
2 2 B 3 11AO Java supports ____________
8 0 D 3 BJ
2 C A arrays.
3
Aone Btwo
. dimensional . dimensional
Cmulti D
all the above
. dimensional .
Answer is : D
2 2 B 3 11AO Objects interaction through
9 0 D 3 BJ
2 C A sending messages is achieved by
3 ____
A B
methods functions
. .
C D
both none
. .
Answer is : A
3 2 B 3 11AO A class can be thought of as a
0 0 D 3 BJ
2 C A ____
3
A B
data type variable
. .
C D
value none
. .
Answer is : A
3 2 B 3 21AO An object can be thought of as a
1 0 D 3 BJ
2 C A ___________
3
A B
data type variable
. .
Cvalue Dnone
. .
Answer is : B
3 2 B 3 21AO To eliminate redundant code in a
2 0 D 3 BJ
2 C A object oriented program ___ can
3 be used
A B
inheritance data hiding
. .
C D
abstraction none
. .
Answer is : A
3 2 B 3 21AO To take multiple forms in a
3 0 D 3 BJ
2 C A program ____ can be used
3
A B
inheritance polymorphism
. .
C D
abstraction none
. .
Answer is : B
3 2 B 3 21AO API means
4 0 D 3 BJ
2 C A
3
Application Applet
A B
Programming Programming
. .
Interface Interface
Application
C D
Programming none
. .
Interchange
Answer is : A
3 2 B 3 21AO
5 0 D 3 BJ
2 C A
3 Which one of the following is an
access specifier ?
A B
private public
. .
C Dall of the
protected
. . above
Answer is : D
3 2 B 3 21AO Which keyword is used to
6 0 D 3 BJ
2 C A prevent a method from being
3 overridden in Java?
A B
'static' 'final'
. .
C D
'abstract' j'override'
. .
Answer is : B
3 2 B 3 21AO In order for a source code file,
7 0 D 3 BJ
2 C A containing the public class Test,
3 to successfully compile, which
of the following must be true?
It must have a It must be
A B
package named
. .
statement Test.java
It must declare
CIt must import D
a public class
. java.lang .
named Test
Answer is : B
3 2 B 3 21AO What output is displayed as the
8 0 D 3 BJ
2 C A result of executing the following
3 statement?

System.out.println("// Looks like


a comment.");
A// Looks like a B
compile error
. comment .
C Dno output
run time error
. . displayed
Answer is : A
3 2 B 3 21AO Which of the following features
9 0 D 3 BJ
2 C A are common to both Java & C+
3 +?
AThe class BThe access
. declaration . modifiers
The
encapsulation
C Dall of the
of data &
. . above
methods with in
objects
Answer is : D
4 2 B 3 21AO When might your program wish
0 0 D 3 BJ
2 C A to run the garbage collecter?
3
before it enters before it enters
Aa compute- Ba memory-
. intense section . intense section
of code of code
when it knows
C Dall of the
there will be
. . above
some idle time
Answer is : D
4 2 B 3 21AO What is an example of
1 0 D 3 BJ
2 C A polymorphism?
3
A Bmethod
inner class
. . overloading
Canonymous Dmethod
. class . overriding
Answer is : B
4 2 B 3 21AO Which of the following classes is
2 0 D 3 BJ
2 C A used to perform basic console
3 I/O?
A Bsecurity
system
. . manager
C D
math run time
. .
Answer is : A
4 2 B 3 21AO Which of the following are true?
3 0 D 3 BJ
2 C A
3
The Float
The Void class
A Bclass extends
extends the
. . the Double
Class class.
class.
The System The Integer
Cclass extends Dclass extends
. the Runtime . the Number
class. class
Answer is : D
4 2 B 3 21AO Which of the following will
4 0 D 3 BJ
2 C A output -4.0
3
System.out.pri System.out.pri
A B
ntln(Math.floo ntln(Math.roun
. .
r(-4.7)); d(-4.7));
System.out.pri System.out.pri
C D
ntln(Math.ceil ntln(Math.Min
. .
(-4.7)); (-4.7));
Answer is : C
4 2 B 3 21AO Which of the following may be
5 0 D 3 BJ
2 C A part of a class definition?
3
Ainstance B instance
. variables . methods
C D
constructors all the above
. .
Answer is : D
4 2 B 3 21AO What is the default value of
6 0 D 3 BJ
2 C A byte ?
3

A B0b default
0 default value
. . value
C0.0 default D0.0f default
. value . value
Answer is : A
4 2 B 3 21AO What is the default size of
7 0 D 3 BJ
2 C A byte ?
3
A B
i bit 1 byte
. .
C D
2 bytes 4 bytes
. .
Answer is : B
4 2 B 3 21AO What are the Type Conversions
8 0 D 3 BJ
2 C A available in Java language?
3
Narrowing Widening
A B
Type Type
. .
Conversion Conversion
C DNone of the
A and B
. . above
Answer is : C
4 2 B 3 21AO Type promotion in Java usually
9 0 D 3 BJ
2 C A refers to ____.
3
Narrowing Widening
A B
Type Type
. .
Conversion Conversion
CNo Type DString
. Conversion . Conversion
Answer is : B
5 2 B 3 21AO Type Casting in Java usually
0 0 D 3 BJ
2 C A refers to ____.
3
Narrowing Widening
A B
Type Type
. .
Conversion Conversion
CNo Type DType
. Conversion . promotion
Answer is : A
5 2 B 3 21AT/ Explicit Type Conversion in Java
1 0 D 3 F
2 C A refers to Narrowing Type
3 Conversion.
A B
True False
. .

Answer is : TRUE

5 2 B 3 21AO Which are the compatible Data


2 0 D 3 BJ
2 C A Types for Type Promotion or
3 Type Casting.
A B
byte, char, short char, int, float
. .

C float, long, D
all the above
. double .

Answer is : D

5 2 B 3 21AT/ An IF-ELSE statement is also called


3 0 D 3 F
2 C A Unbranching statemement
3
A B
True False
. .

Answer is : FALSE

5 2 B 3 21AO An IF or ELSE IF statement


4 0 D 3 BJ
2 C A accepts ___ as input before
3 branching.
A B
boolean int
. .

C D
float char
. .

Answer is : A

5 2 B 3 21AO If the condition of an IF-


5 0 D 3 BJ
2 C A statement is false, which is true
3 below.
AIF block is BELSE block is
. executed. . executed.

Both IF and Both IF and


C D
ELSE blocks are ELSE blocks are
. .
skipped executed
Answer is : B

5 2 B 3 21AO What is maximum lines of code


6 0 D 3 BJ
2 C A that can be written inside a Java
3 style IF, ELSE or IF-ELSE
block?

A B
32 64
. .

C D
512 None
. .

Answer is : D

5 2 B 3 21AO
7 0 D 3 BJ What is the purpose of the
2 C A
3 continue statement in a loop?
To skip the
current
ATo exit the loop B
iteration and
. immediately .
move to the
next iteration

To execute a
C To terminate D
specific block
. the program .
of code

Answer is : B

5 2 B 3 21AO Which loop construct in Java


8 0 D 3 BJ
2 C A is best suited when the number
3 of iterations is unknown?

A B
for loop while loop
. .

C D
do-while loop none
. .

Answer is : B
5 2 B 3 21AO Which keyword in Java is used
9 0 D 3 BJ
2 C A for constant variables?
3
A B
const static
. .

C D
constant final
. .

Answer is : D

6 2 B 3 21AO Which of the following is a


0 0 D 3 BJ
2 C A valid variable name in Java?
3
A B
-myVar my_var
. .

C D
3times float
. .

Answer is : B

6 2 B 3 31AO Which will legally declare,


1 0 D 3 BJ
2 C A construct, and initialize an array?
3

Aint [] myList = B
int [] myList =
. {"1", "2", "3"}; . (5, 8, 2);

C int myList [] [] = Dint myList [] =


. {4,9,7,0}; . {4, 3, 7};

Answer is : D

6 2 B 3 31AO Which operator is to create and


2 0 D 3 BJ
2 C A concatenate string?
3

AAddition B
& operator
. operator(+). .

C D
|| operator none
. .
Answer is : A

6 2 B 3 31AO Which of the following


3 0 D 3 BJ
2 C A statements can be used to
3 describe a public method?

It is accessible It is accessablde
Ato all other Bonly to
. classes in the . subclasses of its
hierarchy parent class

It represents
C D
the public both a and c
. interface of its .
class

Answer is : D

6 2 B 3 31AO Which one of the following will


4 0 D 3 BJ
2 C A declare an array and initialize it
3 with five numbers?

AArray a = Bint [] a =
. new . {23,22,21,20,19
Array(5); };
C D
int a [] = int [5] array;
. new int[5]; .

Answer is : B

6 2 B 3 31AO Which is a reserved word in the


5 0 D 3 BJ
2 C A Java programming language?
3
A B
method native
. .

C D
sub classes reference
. .

Answer is : B

6 2 B 3 31AO Which of the following statements


6 0 D 3 BJ
2 C A are true about the fragment
3 below?
import java.lang.Math;
public class Test {
public static void main(String args[])
{
Math m = new Math();
System.out.println(m.abs(2.6);
}}

ACompiler fails at B Compiler fails


. line 1 . at line 2

Compiler fails at
C the time of DCompiler
. Math class . succeeds.
instantiation

Answer is : C

6 2 B 3 31AO The synchronized is used in which


7 0 D 3 BJ
2 C A of the following?
3
AClass BMethod
. declarations . declarations

CBlock of code D
both b and c
. declarations .

Answer is : D

6 2 B 3 31AO What will be the result of the


8 0 D 3 BJ
2 C A expression 9 | 9?
3
A B
9 0
. .

C D
1 4
. .

Answer is : A

6 2 B 3 31AO What is false about


9 0 D 3 BJ constructor?
2 C A
3
AConstructors BJava does
cannot be not provide
. synchronized . default copy
in Java constructor
“this” and
C Constructor D“super” can be
. can have a . used in a
return type
constructor

Answer is : C

7 2 B 3 31AT/ . Abstract class cannot have a


0 0 D 3 F
2 C A constructor.
3
A B
True False
. .

Answer is : FALSE

7 2 B 3 31AO Consider the following class


1 0 D 3 BJ
2 C A definition.
3
class Student extends String

What happens when we try to


compile this class?
will not will not
Acompile Bcompile
. because class . because the
body is not class is not
defined declared public
will not
C Dwill compile
compile
. because String . sucessfully
is abstract

Answer is : D

7 2 B 3 31AO What is wrong in the following


2 0 D 3 BJ
2 C A class definitions?
3
abtract class Print

abstract show();
}

Class Display extends Print

}
wrong, method
A Bshow() should
nothing is wrong
. . have a return
type

wrong, method wrong, display


Cshow() is not Ddoes not
. implemented in . contain any
display members

Answer is : C

7 2 B 3 31AO Which of the following types of


3 0 D 3 BJ
2 C A class members can be part of the
3 internal part of a class?
APublic instance BPrivate instance
. variables . variables

C Private D
both b and c
. methods .

Answer is : D

7 2 B 3 31AO Public classTest { }


4 0 D 3 BJ
2 C A
3 What is the prototype of the
default constructor?
A B
Test() Test(void)
. .

C D public
public Test()
. . Test(void)

Answer is : C

7 2 B 3 31AO Which of the following methods


5 0 D 3 BJ
2 C A are methods of the String class?
3
A delete( ) Bappend( )
. .

C D
replace()
. reverse( ) .

Answer is : D

7 2 B 3 31AO Which of the following methods


6 0 D 3 BJ
2 C A cause the String object
3 referenced by s to be changed?
A B
s.concat( ) s.toUpperCase(
. .)

C D
both a and b
. s.replace( ) .

Answer is : D

7 2 B 3 31AO What are the interfaces defined


7 0 D 3 BJ
2 C A by java.lang?
3
A B
Cloneable Comparable
. .

C D
Runnable all the above
. .

Answer is : D

7 2 B 3 31AO Interfaces in java


8 0 D 3 BJ achieves
2 C A
3
A B
Multiple Multilevel
. inheritance . inheritance

C Dsingle level
Hierarchial
. inheritance . inheritance

Answer is : A

7 2 B 3 31AO
9 0 D 3 BJ
The classes contained in the_________ of other programs can
2 C A be easily reused.
3
A B
pointers packages
. .

Cinterface Dnone
. .

Answer is : B

8 2 B 3 31AO What is not the use of “this”


0 0 D 3 BJ
2 C A keyword in Java?
3
Calling
another
APassing itself to B
constructor in
. another method .
constructor
chaining

Referring to the
Passing itself
instance variable
C Dto method of
when local
. . the same
variable has the
class
same name

Answer is : D

8 2 B 3 31AO Which of the following class


1 0 D 3 BJ
2 C A level (nonlocal) variable
3 declarations will not compile?
A Btransient int b
. protected int a; . = 3;

private
C D
synchronized int volatile int d;
. .
e;

Answer is : C

8 2 B 3 31AO If a class inheriting an abstract class


2 0 D 3 BJ
2 C A does not define all of its function
3 then it will be known as?

A B
abstract simple class
. .

C D
static thread
. .

Answer is : A

8 2 B 3 31AO Which of this keyword must be


3 0 D 3 BJ used to inherit a class?
2 C A
3
A B
extend extends
. .

C D
inherits base
. .

Answer is : B

8 2 B 3 31AO What would be the result if a class


4 0 D 3 BJ
2 C A extends two interfaces and both
3 have a method with same name
and signature? Lets assume that
the class is not implementing that
method.

A compile time B
run time error
. error .

First called
C code runs D method is
. sucessfully . executed
successfully

Answer is : B

8 2 B 3 31AO Which of the interface contains all


5 0 D 3 BJ
2 C A the methods used for handling
3 thread related operations in Java?

ARunnable B
Math interface
. interface .

CSystem DThreadHandling
. interface . interface

Answer is : A

8 2 B 3 31AO Which of these class is used to


6 0 D 3 BJ
2 C A make a thread?
3
A B
String System
. .

CThread DRunnable
. .

Answer is : C

8 2 B 3 31AO What would be the behaviour if


7 0 D 3 BJ
2 C A one parameterized constructor is
3 explicitly defined?

ACompilatio BCompilation
. n error . succeeds

Compilation
succeeds but at the
time of creating
CRuntime D
object using default
. error .
constructor, it
throws compilation
error

Answer is : D

8 2 B 3 31AO What is an event in delegation


8 0 D 3 BJ
2 C A event model used by Java
3 programming language?
An event is an An event is an
object that object that
A B
describes a state describes a
. .
change in a state change in
source processing

An event is an An event is a
object that class used for
C D
describes any defining
. .
change by the object, to
user and system create events

Answer is : A

8 2 B 3 31AO What is Inheritance in Java


9 0 D 3 BJ
2 C A programming?
3
AIt's a process BIt's a process of
. where one class . creating a new
acquires the class using the
properties main() method.
(fields) and
behaviors
(methods) of
another class.

It's a Java-
It's a technique
C Dspecific term for
to create
. . importing
objects in Java.
packages.

Answer is : A

9 2 B 3 31AO Which keyword is used for


0 0 D 3 BJ
2 C A inheritance in Java?
3
A B
extends new
. .

C D
super this
. .

Answer is : A

9 2 B 3 41AO Which of these keywords is used to


1 0 D 3 BJ
2 C A define packages in Java?
3
A B
pkg Pkg
. .

C D
package interface
. .

Answer is : C

9 2 B 3 41AO Which of the following is an


2 0 D 3 BJ
2 C A incorrect statement about
3 packages?

Package
defines a
A package can
Anamespace B
contain other
. in which .
package within it
classes are
stored

CJava uses file DA package can be


. system renamed without
renaming the
directories
directory in which
to store .
the classes are
packages
stored

Answer is : D

9 2 B 3 41AO What is multithreaded


3 0 D 3 BJ
2 C A programming?
3
It’s a process in
It’s a process in
which two or
which two
A Bmore parts of
different
. . same process
processes run
run
simultaneously
simultaneously

It’s a process in
It’s a process in
which a single
which many
process can
Cdifferent
Daccess
. process are able
information
to access same
from many
information
sources

Answer is : A

9 2 B 3 41AO Which of these are types of


4 0 D 3 BJ
2 C A multitasking?
3
A B
Process based Thread based
. .

C Process and Dnone of the


. Thread based . above

Answer is : C

9 2 B 3 41AO Thread priority in Java is?


5 0 D 3 BJ
2 C A
3
A B
Integer double
. .
C D
float long
. .

Answer is : A

9 2 B 3 41AO What will happen if two thread of


6 0 D 3 BJ
2 C A the same priority are called to be
3 processed simultaneously?

Anyone will be Both of them


A B
executed first will be executed
. .
lexographically simultaneously

It is dependent
CNone of them Don the
. will be executed . operating
system

Answer is : D

9 2 B 3 41AO Which of these statements is


7 0 D 3 BJ
2 C A incorrect?
3
By
By multitasking
multithreading
CPU idle time is
CPU idle time is
A Bminimized, and
minimized, and
. . we can take
we can take
maximum use of
maximum use
it
of it

Two thread in A thread can


CJava can have Dexist only in two
. the same . states, running
priority and blocked

Answer is : D

9 2 B 3 41AO Which of these packages contains


8 0 D 3 BJ
2 C A all the classes and methods
3 required for even handling in Java?

A B
java.applet java.awt
. .
C D
java.event java.awt.event
. .

Answer is : D

9 2 B 3 41AO Which of these methods are used


9 0 D 3 BJ
2 C A to register a keyboard event
3 listener?

A B
KeyListener() addKistener()
. .

C D
addKeyListene eventKeyboardLi
. .
r() stener()

Answer is : C

1 2 B 3 41AO Which of these methods are used


0 0 D 3 BJ
0 2 C A to register a mouse motion
3 listener?
A B
addMouse() addMouseListen
. .
er()

C D
addMouseMoti eventMouseMo
. .
onListner() tionListener()

Answer is : C

1 2 B 3 41AO What is a listener in context to


0 0 D 3 BJ
1 2 C A event handling?
3
A listener is
A listener is a
a object that
Avariable that is B
is notified
. notified when .
when an
an event occurs
event occurs
A listener is a
Cmethod that is D None of the
. notified when . mentioned
an event occurs
Answer is : B
1 2 B 3 41AO Event class is defined in which
0 0 D 3 BJ
2 2 C A of these libraries?
3
A B
java.io java.lang
. .
C D
java.net java.util
. .
Answer is : D
1 2 B 3 41AO Which of these methods can be
0 0 D 3 BJ
3 2 C A used to determine the type of
3 event?

A B
getID() getSource()
. .
C D
getEvent() getEventObject
. .
()
Answer is : A
1 2 B 3 41AO Which of these class is super
0 0 D 3 BJ
4 2 C A class of all the events?
3

A B
EventObject EventClass
. .
C D
ActionEvent ItemEvent
. .
Answer is : A
1 2 B 3 41AO Which of these events will be
0 0 D 3 BJ
5 2 C A notified if scroll bar is
3 manipulated?
A BComponentEv
ActionEvent
. . ent
CAdjustmentEv D
WindowEvent
. ent .
Answer is : C
1 2 B 3 41AO Which of these events will be
0 0 D 3 BJ
6 2 C A generated if we close an applet’s
3 window?

A B
ActionEvent ComponentEv
. .
ent
CAdjustmentEv D
WindowEvent
. ent .
Answer is : D
1 2 B 3 41AO When does Exceptions in Java
0 0 D 3 BJ
7 2 C A arises in code sequence?
3
B Compilation
. Run Time
. Time
C Can Occur D None of the
. Any Time . mentioned
Answer is : A
1 2 B 3 41AO Which of these keywords is not a
0 0 D 3 BJ
8 2 C A part of exception handling?
3

A B
try finally
. .
C D
thrown catch
. .
Answer is : C
1 2 B 3 41AO Which of these keywords must
0 0 D 3 BJ
9 2 C A be used to monitor for
3 exceptions?

A B
try finally
. .
C D
throw catch
. .
Answer is : A
1 2 B 3 41AO Which of these keywords must
1 0 D 3 BJ
0 2 C A be used to handle the exception
3 thrown by try block in some
rational manner?

A B
try finally
. .
C D
throw catch
. .
Answer is : D
1 2 B 3 41AO Which of these keywords is used
1 0 D 3 BJ
1 2 C A to manually throw an exception?
3

Atry B finally
. .
C D
throw catch
. .
Answer is : C
1 2 B 3 41AO Which of these packages
1 0 D 3 BJ
2 2 C A contains all the event handling
3 interfaces?

A B
java.lang java.awt
. .
C D
java.event
. java.awt.event .
Answer is : C
1 2 B 3 41AO Which of these interfaces
1 0 D 3 BJ
3 2 C A handles the event when a
3 component is added to a
container?

AComponentLis B
ContainerListe
. tener .
ner
C D
FocusListener InputListener
. .
Answer is : B
1 2 B 3 41AO Which of these interfaces define
1 0 D 3 BJ
4 2 C A a method actionPerformed()?
3

A BContainerList
ComponentList
. . ener
ener
C D
ActionListener InputList
. .
Answer is : C
1 2 B 3 41AO Which of these interfaces define
1 0 D 3 BJ
5 2 C A a method itemStateChanged()?
3
AComponentLis BContainerList
. tener . ener
C D
ActionListener ItemListener
. .
Answer is : C
1 2 B 3 41AO Which of these methods will
1 0 D 3 BJ respond when you click any
6 2 C A
3 button by mouse?
A B
mouseClicked mouseEntered
. .
() ()
C D all of the
mousePressed(
. . mentioned
)
Answer is : D
1 2 B 3 41AO Which is the container that
1 0 D 3 BJ
7 2 C A doesn't contain title bar and
3 MenuBars but it can have other
components like button, textfield
etc?

A B
Window Frame
. .
C D
Panel Container
. .
Answer is : C
1 2 B 3 41AO Give the abbreviation of AWT?
1 0 D 3 BJ
8 2 C A
3
Applet Abstract
A B
Windowing Windowing
. .
Toolkit Toolkit
Absolute
C D None of the
Windowing
. . above
Toolkit
Answer is : B
1 2 B 3 41AO Which method is used to set the
1 0 D 3 BJ
9 2 C A graphics current color to the
3 specified color in the graphics
class?

public abstract public


Avoid Babstract void
. setFont(Font . setColor(Col
font) or c)
public abstract
void
C D None of the
drawString(Stri
. . above
ng str, int x, int
y)
Answer is : B
1 2 B 3 41AO In Graphics class which method
2 0 D 3 BJ
0 2 C A is used to draws a rectangle with
3 the specified width and height?
public void public abstract
drawRect(int void
A B
x, int y, int fillRect(int x,
. .
width, int int y, int width,
height) int height)
public abstract
public
void
abstract void
C DdrawOval(int
drawLine(int
. . x, int y, int
x1, int y1, int
width, int
x2, int y2)
height)
Answer is : A
1 2 B 3 51AO Which of these class contains the
2 0 D 3 BJ
1 2 C A methods used to write in a file?
3

A BFileInputStre
FileStream
. . am
CBUfferedOutpu DFileBufferStr
. tStream . eam
Answer is : B
1 2 B 3 51AO Which of these exception is
2 0 D 3 BJ
2 2 C A thrown in cases when the file
3 specified for writing is not
found?
A B
IOException FileException
. .
CFileNotFoundE DFileInputExce
. xception . ption
Answer is : C
1 2 B 3 51AO Which of these class contains
2 0 D 3 BJ
3 2 C A the methods used to write in a
3 file?
A BFileInputStre
FileStream
. . am
CBUfferedOutpu DFileBufferStr
. tStream . eam
Answer is : B
1 2 B 3 51AO Which of these methods are used
2 0 D 3 BJ
4 2 C A to read in from file?
3
Aget() B read()
. .
C D
scan() readFileInput()
. .
Answer is : B
1 2 B 3 51AO Which of these values is returned
2 0 D 3 BJ
5 2 C A by read() method is end of file
3 (EOF) is encountered?

A B
0 1
. .
C D
-1 Null
. .
Answer is : C
1 2 B 3 51AO Which of these exception is
2 0 D 3 BJ
6 2 C A thrown by close() and read()
3 methods?
A B
IOException FileException
. .
CFileNotFound DFileInputOutpu
. Exception . tException
Answer is : A
1 2 B 3 51AO What will be the output of the
2 0 D 3 BJ
7 2 C A following Java program?
3

1. import java.io.*;
2. class
filesinputoutput
3. {
4. public
static void
main(String args[])
5. {
6.
InputStream obj =
new
FileInputStream("inp
utoutput.java");
7.
System.out.print(obj
.available());
8. }
9. }

A B
true false
. .
Cprints number Dprints number
. of bytes in file . of characters
in the file
Answer is : C
1 2 B 3 51AO Which of these stream contains
2 0 D 3 BJ
8 2 C A the classes which can work on
3 character stream?
A B
InputStream OutputStream
. .
CCharacter DNone of the
. Stream . above
Answer is : C
1 2 B 3 51AO Which of these class is used to
2 0 D 3 BJ
9 2 C A read characters in a file?
3
A B
FileReader FileWriter
. .
CFileInputStrea DInputStreamRe
.m . ader
Answer is : A
1 2 B 3 51AO Which of these method of
3 0 D 3 BJ
0 2 C A FileReader class is used to read
3 characters from a file?
A B
read() scanf()
. .
C D
get() getInteger()
. .
Answer is : A
1 2 B 3 51AO Which of these class can be used
3 0 D 3 BJ
1 2 C A to implement the input stream
3 that uses a character array as the
source?

ABufferedReade B
FileReader
.r .
CCharArrayRea DFileArrayRead
. der . er
Answer is : C
1 2 B 3 51AO Which of these classes can return
3 0 D 3 BJ
2 2 C A more than one character to be
3 returned to input stream?
ABufferedRead B
Bufferedwriter
. er .
CPushbachRead DCharArrayRea
. er . der
Answer is : C
1 2 B 3 51AO What is the abbreviation of
3 0 D 3 BJ
3 2 C A ASCII?
3
American Australian
Standard Standard
A B
Characters for Code for
. .
Information Information
Interchange Interchange
American Stan American Stan
Cdard Code for Ddard Code for
. Information . Interchange
Interchange Information
Answer is : C
1 2 B 3 51AO What is the size of a CHAR data
3 0 D 3 BJ
4 2 C A type constant in Java?
3
A B
1 byte 2 bytes
. .
C D
4 bytes 6 bytes
. .
Answer is : B
1 2 B 3 51AO What is the character encoding
3 0 D 3 BJ
5 2 C A standard used in Java
3 language?
A B
ASCII Unicode
. .
C D
Hexacode Bytecode
. .
Answer is : C
1 2 B 3 51AO What is the primary purpose of
3 0 D 3 BJ
6 2 C A input streams in Java?
3
ATo write data BTo read data
. to a file. . from a file.
CTo append DTo create
. data to a file. . directories.
Answer is : B
1 2 B 3 51AO Which class in Java is used to
3 0 D 3 BJ
7 2 C A create a new directory?
3
A B
FileReader FileWriter
. .
C D
File Directory
. .
Answer is : C
1 2 B 3 51AO What is the purpose of the
3 0 D 3 BJ
8 2 C A FileOutputStream class in Java?
3

To write To read binary


A B
binary data to data from a
. .
a file. file.
CTo create a DTo append text
. new file. . to a file.

Answer is : A
1 2 B 3 51AO Which method is used to check if
3 0 D 3 BJ
9 2 C A a file or directory exists in Java?
3
A BcreateNewFile(
exists()
. .)
CmakeDirector D isFileOrDirect
. y() . ory()
Answer is : A
1 2 B 3 51AO What is the purpose of the
4 0 D 3 BJ
0 2 C A FileReader class in Java?
3
To read binary To write
A B
data from a binary data to
. .
file. a file.
To read To write
C D
character data character data
. .
from a file. to a file.

Answer is : C
1 2 B 3 51AO What is the purpose of the
4 0 D 3 BJ
1 2 C A File.separator constant in Java?
3
To separate
To separate
A Bdirectories and
text within a
. . files in file
file.
paths.
To
CTo define the Dconcatenate
. end of a file. . strings in file
operations.
Answer is : B
1 2 B 3 51AO Which class is used for efficient
4 0 D 3 BJ
2 2 C A reading of characters from a file
3 in Java?
A BFileInputStrea
FileReader
. .m
CBufferedRead DDataInputStrea
. er .m
Answer is : C
1 2 B 3 51AO Which class is used to write
4 0 D 3 BJ
3 2 C A serialized objects to a file in
3 Java?
AObjectInputStr BFileOutputStr
. eam . eam
CObjectOutputS D
FileWriter
. tream .
Answer is : C
1 2 B 3 51AO What does the File.delete()
4 0 D 3 BJ
4 2 C A method do in Java?
3
Appends text
A B
Delete a file to an existing
. .
file.
Delete binary
CDeletes a file D
data from a
. or directory. .
file.
Answer is : C
1 2 B 3 51AO What is the primary purpose of
4 0 D 3 BJ
5 2 C A the RandomAccessFile class in
3 Java?
ATo read data BTo write data
. from a file. . to a file
To read and
write data at a
C DTo create
specific
. . directories.
position in a
file.

Answer is : C
1 2 B 3 51AO What is the role of the
4 0 D 3 BJ
6 2 C A BufferedInputStream class in
3 Java file handling?
To read To read binary
A B
character data data from a
. .
from a file. file efficiently.
CTo create a DTo append text
. new file. . to an existing
file.

Answer is : B
1 2 B 3 51AO An expression involving byte,
4 0 D 3 BJ
7 2 C A int, and literal numbers is
3 promoted to which of these?
A B
int long
. .
C D
byte float
. .
Answer is : A
1 2 B 3 51AO Which data type value is
4 0 D 3 BJ
8 2 C A returned by all transcendental
3 math functions?
A B
int float
. .
C D
double long
. .
Answer is : C
1 2 B 3 51AO What is the entry point of a
4 0 D 3 BJ
9 2 C A program in Java?
3
A Bthe first line
main()method
. . of code
C D
last line of code main class
. .
Answer is : A
1 2 B 3 51AO Which data type is used to store
5 0 D 3 BJ
0 2 C A floating point numbers with
3 single precision in java.
A B
float double
. .
C D
decimal real
. .
Answer is : A
1 2 B 3 11B D Classify Java support systems.
5 0 D 3 ES
1 2 C A C
3
1 2 B 3 11B D How to implement a java program.
5 0 D 3 ES
2 2 C A C
3
1 2 B 3 11B D Explain about java program
5 0 D 3 ES
3 2 C A C structure
3

1 2 B 3 11B D Compare and contrast World Wide


5 0 D 3 ES Web and Web Browsers
4 2 C A C
3

1 2 B 3 11B D Explain tokens with suitable


5 0 D 3 ES example.
5 2 C A C
3
1 2 B 3 11B D Summarize the Java virtual
5 0 D 3 ES machine.
6 2 C A C
3
1 2 B 3 11B D Explain the Java characteristics.
5 0 D 3 ES
7 2 C A C
3
1 2 B 3 11B D Distinguish between tokens and
5 0 D 3 ES statements in java.
8 2 C A C
3
1 2 B 3 11B D Illustrate a JVM?How it is works.
5 0 D 3 ES
9 2 C A C
3
1 2 B 3 11B D What is the main use of JVM.
6 0 D 3 ES
0 2 C A C
3
1 2 B 3 21B D Illustrate Constants.
6 0 D 3 ES
1 2 C A C
3
1 2 B 3 21B D How to declare variables in Java.
6 0 D 3 ES
2 2 C A C
3
1 2 B 3 21B D Outline the general format of While
6 0 D 3 ES statement.
3 2 C A C
3
1 2 B 3 21B D Explain operator with examples
6 0 D 3 ES
4 2 C A C
3
1 2 B 3 21B D Determine the expressions.
6 0 D 3 ES
5 2 C A C
3
1 2 B 3 21B D Examine the features of labeled
6 0 D 3 ES loops.
6 2 C A C
3
1 2 B 3 21B D Examine the general format of
6 0 D 3 ES switch statement.
7 2 C A C
3
1 2 B 3 21B D Explain about while statement in
6 0 D 3 ES Java.
8 2 C A C
3
1 2 B 3 21B D Explain about jump statement in
6 0 D 3 ES loops.
9 2 C A C
3
1 2 B 3 21B D Elaborate data types in java.
7 0 D 3 ES
0 2 C A C
3
1 2 B 3 31B D Summarize the classes.
7 0 D 3 ES
1 2 C A C
3
1 2 B 3 31B D Identify the visibility control in java.
7 0 D 3 ES
2 2 C A C
3
1 2 B 3 31B D How to define method?
7 0 D 3 ES
3 2 C A C
3
1 2 B 3 31B D Summarize a constructor?
7 0 D 3 ES
4 2 C A C
3
1 2 B 3 31B D create methods in java in detail.
7 0 D 3 ES
5 2 C A C
3
1 2 B 3 31B D Examine the functions of
7 0 D 3 ES constructor with example
6 2 C A C
3
1 2 B 3 31B D Explain Interface with example.
7 0 D 3 ES
7 2 C A C
3
1 2 B 3 31B D Which is the keyword used to
7 0 D 3 ES implement interface?
8 2 C A C
3
1 2 B 3 31B D Illustrate an array?Explian the
7 0 D 3 ES types of Arrays with example.
9 2 C A C
3
1 2 B 3 31B D Summarize a vectors.
8 0 D 3 ES
0 2 C A C
3
2 2 B 3 11CD List any five major difference
0 0 D 3 ES between C++ and java
1 2 C A C
3
2 2 B 3 11CD Classify the features of java.
0 0 D 3 ES explain
2 2 C A C
3
2 2 B 3 11CD Explain about control structures in
0 0 D 3 ES
3 2 C A C java
3

2 2 B 3 11CD Write a java program to find


0 0 D 3 ES greatest among two numbers.
4 2 C A C
3
2 2 B 3 11CD Extend command line argument
0 0 D 3 ES with example program.
5 2 C A C
3
2 2 B 3 11CD Construct a Java program to find
0 0 D 3 ES the Largest number
6 2 C A C
3
2 2 B 3 11CD Construct a java program to sorting
0 0 D 3 ES the given strings.
7 2 C A C
3
2 2 B 3 11CD What is the contribution of java to
0 0 D 3 ES the World Wide Web.Explain Briefly
8 2 C A C
3
2 2 B 3 11CD How many command line
0 0 D 3 ES arguments we can pass in Java?
9 2 C A C Explain briefly with example
3

2 2 B 3 11CD Illustrate the functions used in


1 0 D 3 ES command line arguments.
0 2 C A C
3
2 2 B 3 21CD How to get input from java? Explain
1 0 D 3 ES with example
1 2 C A C
3
2 2 B 3 21CD Explain in detail Arithmetic
1 0 D 3 ES Operators with example
2 2 C A C
3
2 2 B 3 21CD How will you convert one data type
1 0 D 3 ES to another?
3 2 C A C
3
2 2 B 3 21CD Explain swich statement with an
1 0 D 3 ES example.
4 2 C A C
3
2 2 B 3 21CD Explain the concept of if ..else
1 0 D 3 ES statement with example.
5 2 C A C
3
2 2 B 3 21CD Explain about the operators
1 0 D 3 ES available in Java.
6 2 C A C
3
2 2 B 3 21CD Construct a java program using do
1 0 D 3 ES while statement.
7 2 C A C
3

2 2 B 3 21CD Construct a program using For


1 0 D 3 ES method overloading in Java.
8 2 C A C
3
2 2 B 3 21CD Construct a program to reverse a
1 0 D 3 ES given number.
9 2 C A C
3
2 2 B 3 21CD Construct a program to sort the
2 0 D 3 ES given strings.
0 2 C A C
3
2 2 B 3 31CD Explain the rules to define classes
2 0 D 3 ES and methods
1 2 C A C
3
2 2 B 3 31CD Explain about creating a class with
2 0 D 3 ES syntax and example
2 2 C A C
3
2 2 B 3 31CD Explain wrapper class?
2 0 D 3 ES
3 2 C A C
3
2 2 B 3 31CD Explain how to implement and
2 0 D 3 ES extend interface with syntax
4 2 C A C
3
2 2 B 3 31CD Explain about accessing interface
2 0 D 3 ES variables. Give an example
5 2 C A C program
3

2 2 B 3 31CD Explain arrays with sample


2 0 D 3 ES program.
6 2 C A C
3
2 2 B 3 31CD Explain multiple inheritance in
2 0 D 3 ES detail.
7 2 C A C
3
2 2 B 3 31CD Explain about string arrays in Java.
2 0 D 3 ES
8 2 C A C
3
2 2 B 3 31CD construct a java program to find
2 0 D 3 ES area of rectangle using multiple
9 2 C A C inheritance
3

2 2 B 3 31CD Demonstrate a program to


3 0 D 3 ES implement multiple inheritances
0 2 C A C using interface.
3

You might also like