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

Java

The document consists of a series of questions and answers related to Java programming concepts, including keywords, data types, and coding practices. It covers various topics such as array initialization, reserved words, and Java's features like platform independence and distributed programming. Each question is followed by multiple-choice answers, with the correct answer indicated for each question.

Uploaded by

vijayramesh252
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Java

The document consists of a series of questions and answers related to Java programming concepts, including keywords, data types, and coding practices. It covers various topics such as array initialization, reserved words, and Java's features like platform independence and distributed programming. Each question is followed by multiple-choice answers, with the correct answer indicated for each question.

Uploaded by

vijayramesh252
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 53

Q.

S Y M U CH S
S T
. E AJ N AP E
U Y QUESTION
N A O I TE C
B P
OR R T R .
E
1 2 B 2 1 1 A O Which one of these lists
0 AI 3 BJ
2 A contains only Java
4 programming language
keywords?
goto,
class, if, instanceof,
Avoid, long, Bnative,
. Int, . finally,
continue default,
throws
try, virtual, strictfp,
throw, constant,
C D
final, super,
. .
volatile, implements,
transient do
Answer is : B
22 B 21 1 A O Which will legally declare,
0 AI 3 BJ
2 A construct, and initialize an
4 array?
int []
int []
AmyList = B
myList =
. {"1", "2", .
(5, 8, 2);
"3"};
int myList int myList
C D
[] [] = [] = {4, 3,
. .
{4,9,7,0}; 7};
Answer is : D
32 B 21 1 A O Which is a reserved word
0 AI 3 BJ
2 A in the Java programming
4 language?
A B
method native
. .
C D
subclasses reference
. .
Answer is : B
42 B 21 1 A O Which is a valid keyword
0 AI 3 BJ
2 A in java?
4
A B
interface string
. .
C D
Float unsigned
. .
Answer is : A
52 B 21 1 A O Which of the following are
0 AI 3 BJ
2 A legal lines of Java code?
4
1. int w = (int)888.8;

2. byte x = (byte)100L;

3. long y = (byte)100;

4. byte z = (byte)100L;
A B
1 and 2 2 and 3
. .
All
C D
3 and 4 statements
. .
are correct
Answer is : D
62 B 21 1 A O An expression involving
0 AI 3 BJ
2 A byte, int, and literal
4 numbers is promoted to
which of these?
A B
int long
. .
C D
byte float
. .
Answer is : A
72 B 21 1 A O Which data type value is
0 AI 3 BJ
2 A returned by all
4 transcendental math
functions?
A B
int float
. .
C D
double long
. .
Answer is : C
82 B 21 1 A O Which of these coding
0 AI 3 BJ
2 A types is used for data type
4 characters in Java?
A BISO-
ASCII
. . LATIN-1
C DNone of the
UNICODE
. . mentioned
Answer is : C
92 B 21 1 A O Which of these values can
0 AI 3 BJ
2 A a boolean variable contain?
4
ATrue & B
0&1
. False .
CAny integer D
true
. value .
Answer is : A
12 B 21 1 A O Which one is a valid
0 0 AI 3 BJ
2 A declaration of a boolean?
4
Aboolean b1 Bboolean b2
. = 1; . = ‘false’;
Cboolean b3 Dboolean b4
. = false; . = ‘true’
Answer is : C
12 B 21 1 A O Which of the following can
1 0 AI 3 BJ
2 A be operands of arithmetic
4 operators?
A B
Numeric Boolean
. .
Both
C D
Characters Numeric &
. .
Characters
Answer is : D
12 B 21 1 A O Java programs can be esily
2 0 AI 3 BJ
2 A moved from one computer
4 system to another,
anywhere and anytime.
This feature is called as
Platform-
A BObject-
independent
. . oriented
and portable

C D Java
Distributed
. . mobility

Answer is : A
12 B 21 1 A O Java is designed as a
3 0 AI 3 BJ
2 A distributed language for
4 creating applications on
networks. It has the ability
to share both data and
programs. This feature is
called as
A B
Distributed Multicast
. .
C D
Unicast None
. .
Answer is : A
12 B 21 1 A O Java programs support
4 0 AI 3 BJ
2 A functions written in other
4 languages such as C and
C++. These functions are
known as
1. Nativ
e C/c++
A B
meth enabled
. .
ods methods

C D
Extensible None
. .
Answer is : A
12 B 21 1 A O Java does not use
5 0 AI 3 BJ
2 A
4  i.
Preprocessor
header files
 ii. Goto
statement
 iii.
Pointers

1. Bot
1. Onl hi
yi and
A is B ii
. corr . are
ect corr
ect

1. All
1. All
the
the
thre
thre
e
C e D
are
. are .
no
corr
corr
ect
ect

Answer is : C
12 B 21 1 A O Java does not support
6 0 AI 3 BJ
2 A multiple inheritances of
4 classes. This is
accomplished using a new
feature called
A BMultiple
Interface
. . class

C D
Packages  None
. .

Answer is : A
12 B 21 1 A O This is a java compiler,
7 0 AI 3 BJ
2 A which translates java
4 source code to byte code
files that the interpreter can
understand
A B
Javac Java
. .
C D
Javap Jdk1.3
. .
Answer is : A
12 B 21 1 A O This is an access specifier
8 0 AI 3 BJ
2 A that declares the main
4 methods as unprotected
and is accessible to all
other classes.
A B
Public Static
. .
C D
Void Main
. .
Answer is : A
12 B 21 1 A O This declares the main
9 0 AI 3 BJ
2 A method as one that belongs
4 to the entire class and not a
part of any objects of the
class.
A B
Public Static
. .
C D
Void Main
. .
Answer is : B
22 B 21 1 A O This is a type modifier and
0 0 AI 3 BJ
2 A states that the main method
4 does not return any value
A B
Public Static
. .
C D
Void Main
. .
Answer is : C
22 B 21 1 A O These are sequence of
1 0 AI 3 BJ
2 A characters made of digits,
4 letter and other characters

A Java B Java
. Literals . Datatypes

C Java D Java
. Variables . keywords

Answer is : A
22 B 21 1 A O This operator is used
2 0 AI 3 BJ
2 A separate package names
4 form sub-packages and
classes

A B
Period  Arrow
. .

C D
Semicolon  Colon
. .

Answer is : A
22 B 21 1 A O This operator is used to
3 0 AI 3 BJ
2 A separate consecutive
4 identifiers in a variable
declarations, also used to
chain statements together
inside a “for” statement.
A B
Comma Period
. .
C D
Semicolon Colon
. .
Answer is : A
22 B 21 1 A O This operator is used to
4 0 AI 3 BJ
2 A separate statements
4
A B
Comma Period
. .
C D
Semicolon Colon
. .
Answer is : C
22 B 21 1 A O Java compiler produces an
5 0 AI 3 BJ
2 A intermediate code known
4 as byte code for a machine
that does not exist. This
machine is called as
No
A BJava virtual
machine
. . machine
code
C D
Javac Java
. .
Answer is : B
22 B 21 1 A O A class that cannot be
6 0 AI 3 BJ
2 A instantiated directly. This
4 class exist so that
subclasses can inherit
variables an methods from
them


AAbstract B
Inherited
. classes .
classes

C D
 None
. Subclasses .

Answer is : A
22 B 21 1 A O A java program that is
7 0 AI 3 BJ
2 A embedded in an HTML
4 document an runs in the
context of a java-capable
browser
A BJava
HTML tags
. . WWW
CWebjava DApplet
. .
Answer is : D
22 B 21 1 A O __________ is a set
8 0 AI 3 BJ
2 A of API used
4 by Java programmers to
create GUI objects, such
as buttons, scroll bars, and
windows.

A Java B
 Java GUI
. interface .


Abstract 1. Webj
C D
Window ava
. .
Toolkit
(AWT)

Answer is : C
22 B 21 1 A O A class inherits another by
9 0 AI 3 BJ
2 A using the --------------
4 keyword in its declaration.

A B
 Extends  Inherits
. .

 Using Using scope


C D
period resolution
. .
operator operator

Answer is : A
32 B 21 1 A O It is one type of data
0 0 AI 3 BJ
2 A format for storing
4 graphical images on disk.
AGIF B
. .
 GUI
C D
AWT PIC
. .
Answer is : A
32 B 22 1 A O A java-capable browser
1 0 AI 3 BJ
2 A from Javasoft.
4
A B
HotJava WebJava
. .
CJavaBrowse D
WWWjava
.r .
Answer is : A
32 B 22 1 A O A java program that
2 0 AI 3 BJ
2 A performs both language
4 translation and program
execution.
AJavaTransla BJavaInterpr
. tor . eter
C D
Javah Javadoc
. .
Answer is : B
32 B 22 1 A O It is a collection of
3 0 AI 3 BJ
2 A methods and variables that
4 other classes may
implement.
A B
Class Object
. .
C D
Interface Packages
. .
Answer is : C
32 B 22 1 A O A web browser that can
4 0 AI 3 BJ
2 A run java applets
4
Java- Java-
A B
enhanced enabled
. .
browser browser
Java-
C DAll the
capable
. . above
browser
Answer is : D
32 B 22 1 A O A database access API
5 0 AI 3 BJ
2 A from JavaSoft that allows
4 developers to access
databases with Java
Programs.
A B
JDBC OracleJava
. .
C D
JavaSQL DataJava
. .
Answer is : A
32 B 22 1 A O When a class
6 0 AI 3 BJ
2 A simultaneously inherits
4 methods and fields directly
form more than one base
class.
AMultiple BMultilevel
. inheritance . inheritance
CMultipath DNone of the
. inheritance . above
Answer is : A
32 B 22 1 A O What is J2SE?
7 0 AI 3 BJ
2 A
4
Java2Stan
AJavatwoSyste B
dardEditio
. mExtension .
n
JavaTwoStan
C DJava2Syst
dardExtensio
. . emEdition
n
Answer is : B
32 B 22 1 A O Which of these classes is
8 0 AI 3 BJ
2 A not part of Java’s
4 collection framework?
A B
Maps Array
. .
C D
Stack Queue
. .
Answer is : D
32 B 22 1 A O Which of these interface is
9 0 AI 3 BJ
2 A not a part of Java’s
4 collection framework?
A B
List Set
. .
C D
SortedMap SortedList
. .
Answer is : D
42 B 22 1 A O What is Collection in Java?
0 0 AI 3 BJ
2 A
4
A A group of B A group of
. objects . classes
None of
C A group of D
the
. interfaces .
mentioned
Answer is : A
42 B 22 1 A O Which of these interfaces
1 0 AI 3 BJ
2 A declares core method that
4 all collections will have?
A B EventListn
set
. . er
C Comparato D
Collection
.r .
Answer is : D
42 B 22 1 A O Which of these interfaces
2 0 AI 3 BJ
2 A handle sequences?
4

A B
Set List
. .
C Comparato D
Collection
.r .
Answer is : B
42 B 22 1 A O Which of these interfaces
3 0 AI 3 BJ
2 A is not a part of Java’s
4 collection framework?
A B
List Set
. .
C D
SortedMap SortedList
. .
Answer is : D
42 B 22 1 A O Which of these interfaces
4 0 AI 3 BJ
2 A must contain a unique
4 element?
A B
Set List
. .
C D
Array Collection
. .
Answer is : A
42 B 22 1 A O Which of these classes is
5 0 AI 3 BJ
2 A not a member class of
4 java.io package?
A BStringReade
String
. .r
C D
Writer File
. .
Answer is : A
42 B 22 1 A O Which of these packages
6 0 AI 3 BJ
2 A contain classes and
4 interfaces used for input &
output operations of a
program?
A B
java.util java.lang
. .
C D All of the
java.io
. . mentioned
Answer is : C
42 B 22 1 A O Which of this interface is
7 0 AI 3 BJ
2 A not a member of java.io
4 package?
A BObjectInpu
DataInput
. .t
C ObjectFilte D
FileFilter
.r .
Answer is : C
42 B 22 1 A O Which of this class is not
8 0 AI 3 BJ
2 A related to input and output
4 stream in terms of
functioning?
A B
File Writer
. .
C D
InputStream Reader
. .
Answer is : A
42 B 22 1 A O Which of these is specified
9 0 AI 3 BJ
2 A by a File object?
4
A a file in B directory
. disk . path
None of
C directory D
the
. in disk .
mentioned
Answer is : C
52 B 22 1 A O Which of these is method
0 0 AI 3 BJ
2 A for testing whether the
4 specified element is a file
or a directory?
A B
IsFile() isFile()
. .
C D
Isfile() isfile()
. .
Answer is : B
52 B 22 1 A O What is true about private
1 0 AI 3 BJ
2 A constructor?
4
Private
Private
constructor
constructor
ensures
ensures
multiple
Aonly one B
instances
. instance of .
of a class
a class exist
exist at any
at any point
point of
of time
time
Private
Private constructor
constructor allows
C D
eases the creating
. .
instantiatio objects in
n of a class other
classes
Answer is : A
52 B 22 1 A O What would be the
2 0 AI 3 BJ
2 A behaviour if this() and
4 super() used in a method?
ARuns BThrows
. successfully . exception
CRuntime Dcompile
. error . time error
Answer is : D
52 B 22 1 A O What is false about
3 0 AI 3 BJ
2 A constructor?
4
Java does
Constructor
not provide
As cannot be B
default
. synchronize .
copy
d in Java
constructor
“this” and
Constructor “super”
C D
can be can be used
. .
overloaded in a
constructor
Answer is : C
52 B 22 1 A O What is true about
4 0 AI 3 BJ
2 A protected constructor?
4

Protected Protected
constructo constructor
A B
r can be can only be
. .
called called using
directly super()
protected
Protected constructor
constructo can be
Cr can be Dinstantiated
. used . even if child
outside is in a
package different
package
Answer is : B
52 B 22 1 A O What is not the use of
5 0 AI 3 BJ
2 A “this” keyword in Java?
4
Calling
Passing another
Aitself to Bconstructor
. another . in
method constructor
chaining
Referring to
the instance Passing
variable itself to
C D
when local method of
. .
variable has the same
the same class
name
Answer is : D
52 B 22 1 A O To replace a method
6 0 AI 3 BJ
2 A inherited from a superclass
4
A B
override overloaid
. .
Cmethod D
none
. default .
Answer is : A
52 B 22 1 A O This determines the order
7 0 AI 3 BJ
2 A in which mathematical
4 operations are perfomed
operator
Aoperator B
left to right
. precedence .
parsing
Coerder D
none
. operators .
Answer is : A
52 B 22 1 A O This is a java keyowrd
8 0 AI 3 BJ
2 A used to assign the contents
4 of a file to a packages
A B
packages interfaces
. .
C D
class none
. .
Answer is : A
52 B 22 1 A O A programming language
9 0 AI 3 BJ
2 A that can be used on any
4 computer regardless of the
computers operating
systems.
platfor- platform
A B
neutral portable
. .
language language
platform-
C Dall the
independedn
. . above
t language
Answer is : D
62 B 22 1 A O The class at the top of the
0 0 AI 3 BJ
2 A exception class hierarchy
4 is
AArithmetic B
Throwable
. Exception .
C D
Object Exception
. .
Answer is : B
62 B 23 1 A O A programming language
1 0 AI 3 BJ
2 A that can be used on any
4 computer, regardless of the
computers operating
systems.
Platform-
APortable B
neutral
. Language .
language
CProgram D
None
. mobility .
Answer is : B
62 B 23 1 A O Statement with simple
2 0 AI 3 BJ
2 A assignment operator for
4 “a=a+1” is
A B
+a=1
. .
a+=1
C D
a=+1 a<=(a+1)
. .
Answer is : A
62 B 23 1 A O Which of these packages
3 0 AI 3 BJ
2 A contain all the collection
4 classes?
A B
java.lang java.util
. .
C D
java.net java.awt
. .
Answer is : B
6 2 B 2 3 1 A T/ By interface, we cannot
4 0 AI 3 F
2 A support the functionality
4 of multiple inheritances.
A B
True False
. .
Answer is : FALSE
6 2 B 2 3 1 A T/ The Java Virtual
5 0 AI 3 F
2 A Machine is the
4 cornerstone of the
Java platform.
A B
True False
. .
Answer is : TRUE
62 B 23 1 A O Only one super class
6 0 AI 3 BJ
2 A
4
Asingle Bmultiple
. inheritance . inheritance
Chierarchical Dmultilevel
. inheritance . inheritance
Answer is : A
62 B 23 1 A O Several super classes
7 0 AI 3 BJ
2 A
4
Asingle Bmultiple
. inheritance . inheritance
Chierarchical Dmultilevel
. inheritance . inheritance
Answer is : B
62 B 23 1 A O one super class, many
8 0 AI 3 BJ
2 A subclasses
4
Asingle Bmultiple
. inheritance . inheritance
Chierarchical Dmultilevel
. inheritance . inheritance
Answer is : C
62 B 23 1 A O Derived from a derived
9 0 AI 3 BJ
2 A class
4
Asingle Bmultiple
. inheritance . inheritance
Chierarchical D multilevel
. inheritance . inheritance
Answer is : D
72 B 23 1 A O The parameters in the
0 0 AI 3 BJ
2 A super call must _____
4
not match
match the
the order
order and
and type
type of the
of the
Ainstance B
instance
. varibale .
varibale
declared in
declared
the
in the
superclass
superclass
partially
match the
order and
type of the
C Dnone of
instance
. . the above
varibale
declared in
the
superclass
Answer is : A
72 B 23 1 A O In order to free the
1 0 AI 3 BJ
2 A resources we must use
4
Agarbase B
finalizer()
. collector .
C D
freeres() delete()
. .
Answer is : B
72 B 23 1 A O Any variable or method is
2 0 AI 3 BJ
2 A visible to the entire class in
4
which it is defines
Apublic Bfriendly
. access . access
Cprotected Dprivate
. access . access
Answer is : A
72 B 23 1 A O when no access modifier is
3 0 AI 3 BJ
2 A specified, the member
4 deefaults to a limited
version of public
accessibility known as
"friendly" "protected"
A B
level of level of
. .
access access
"private" "public"
C D
level of level of
. .
access access
Answer is : A
72 B 23 1 A O The fields are visible not
4 0 AI 3 BJ
2 A only to all classes and
4 subclasses in the same
package but also to
subclasses in other
packages.
A B
Protected private
. .
C D
public frinedly
. .
Answer is : A
72 B 23 1 A O This enjoys the highes
5 0 AI 3 BJ
2 A degree of data protection
4
A B
private public
. .
C D
protected friendly
. .
Answer is : A
72 B 23 1 A O This modifier makes the
6 0 AI 3 BJ
2 A fields visible in all
4 subclasses regardless of
what package they are in
private friendly
A B
protected protected
. .
access aceess
Cfriendly Dfriendly
private public
. .
access aceess
Answer is : A
72 B 23 1 A O which is the right syntax of
7 0 AI 3 BJ
2 A declaring array?
4
Anum=new Bnum=int
. int[5]; . [5];
Cnum=new Dnum=int[5]
. [5]int; . new;
Answer is : A
72 B 23 1 A O which is right syntax of
8 0 AI 3 BJ
2 A declaring 2D array?
4
myarr =
Aint myarr[] B
new int[3]
. []; .
[4];
int myarr[]
C Dall are
[]=new
. . correct
int[3][4];
Answer is : D
72 B 23 1 A O Interfaces in java is
9 0 AI 3 BJ
2 A
4
intermediat
e app
A Ba multiple
between
. . inheritance
user and
software
Ctype of a D
none
. class only .
Answer is : B
82 B 23 1 A O The major difference
0 0 AI 3 BJ
2 A between an interface and a
4 class is
interface
interface
define
A Bdefine main
abstract
. . methods
methods
only
only
interface
Cdefine class Dno
. methods . difference
only
Answer is : A
82 B 23 1 A O Which of the following
1 0 AI 3 BJ
2 A option is correct?
4
interface interface
A B
can be cannot be
. .
extended extended
interface
C D
can be none
. .
overloaded
Answer is : A
8 2 B 2 3 1 A O class T {
2 0 AI 3 BJ
2 A int t = 20;
4 T() {
t = 40;
}
}
class Main {
public static void m
ain(String args[]) {
T t1 = new T();
System.out.print
ln(t1.t);
}
}
A B
20 40
. .
C D
60 none
. .
Answer is : B
82 B 23 1 A O Which of these functions is
3 0 AI 3 BJ
2 A called to display the output
4 of an applet?

A BdisplayAppl
display()
. . et()
C DPrintApplet(
paint()
. .)
Answer is : C
82 B 23 1 A O Which of these methods
4 0 AI 3 BJ
2 A can be used to output a
4 string in an applet?

AdrawString( B
print()
.) .
C D
transient() display()
. .
Answer is : A
82 B 23 1 A O Which of these methods is
5 0 AI 3 BJ a part of Abstract Window
2 A
4 Toolkit (AWT) ?

A B
display() paint()
. .
CdrawString( D
transient()
.) .
Answer is : B
82 B 23 1 A O Which of these modifiers
6 0 AI 3 BJ
2 A can be used for a variable
4 so that it can be accessed
from any thread or parts of
a program?

No
A B
transient modifier is
. .
needed
C D
global volatile
. .
Answer is : D
82 B 23 1 A O Which of these keywords
7 0 AI 3 BJ
2 A must be used to handle the
4 exception thrown by try
block in some rational
manner?

A B
catch throw
. .
C D
finally try
. .
Answer is : A
82 B 23 1 A O Which of these keywords
8 0 AI 3 BJ
2 A is used to manually throw
4 an exception?

A B
catch throw
. .
C D
finally try
. .
Answer is : B
82 B 23 1 A O 1. class
9 0 AI 3 BJ exception_handli
2 A ng
4 2. {
3. public
static void
main(String
args[])
4. {
5. try
6. {
7.
System.out.print
("Hello" + " " +
1 / 0);
8. }
9.
catch(Arithmetic
Exception e)
10. {
11.
System.out.print
("World");
12. }
13. }
14. }
a)
b)
c)
d)
A B Hello
Hello
. . World
C D
HelloWorld World
. .
Answer is : D
92 B 23 1 A O class exception_handling
0 0 AI 3 BJ
2 A
4 {

public static void


main(String args[])

try

int a, b;

b = 0;

a = 5 / b;

System.out.print("A");

}
catch(ArithmeticException
e)

System.out.print("B");

finally

System.out.print("C");

A B
A AC
. .
C D
B BC
. .
Answer is : D
92 B 24 1 A O Choose the option which
1 0 AI 3 BJ
2 A does not belong to the
4 following statement.
A java package is a group
of similar types of

A B
Classes interfaces
. .
Csub- D
objects
. packages .
Answer is : D
92 B 24 1 A O Package in java can be
2 0 AI 3 BJ
2 A categorized in following
4
form
user-
Abuilt-in B
defined
. package .
package
both a and
C Da only
b are
. . correct
correct
Answer is : C
92 B 24 1 A O java, lang, awt, javax,
3 0 AI 3 BJ
2 A swing, net, io, util, sql
4 etc….the above mentioned
terms

java user-
Ajava built-in B
defined
. packages .
package
both a and
C Da only
b are
. . correct
correct
Answer is : D
92 B 24 1 A O Java package is used to
4 0 AI 3 BJ
2 A categorize the classes and
4 interfaces so that they can
be

Aeasily Beasily
. maintained . accessed
Ceasily Dall the
. tracked . above
Answer is : D
92 B 24 1 A O If you use package.* then
5 0 AI 3 BJ
2 A
4
all the
classes and
but
interfaces
A Bsubpackage
of this
. . s are not
package
accessible
will be
accessible
Ca only Dboth a and b
. correct . only correct
Answer is : D
92 B 24 1 A O If you import
6 0 AI 3 BJ
2 A package.classname then
4

only all classes


declared of the
Aclass of this Bparticular
. package . package
will be will be
accessible accessible
both a and
Ca only D
b are
. correct .
correct
Answer is : C
92 B 24 1 A O Package inside the package
7 0 AI 3 BJ
2 A is called the ____ which
4 should be created to
categorize the package
further.

A B
Subobject Subclass
. .
CSubcategor DSubpackag
.y .e
Answer is : D
92 B 24 1 A O The standard of defining
8 0 AI 3 BJ
2 A package is for e.g
4 com.javatpoint.bean or
org.sssit.dao.. The above
example tells the following

mainpackag domain.co
A B
e.subpackag mpany.pack
. .
e.class age
maindirecto mainclass.o
C D
ry.package.s bject.memb
. .
ubpackage erfunction
Answer is : B
92 B 24 1 A O The Java API is a library
9 0 AI 3 BJ
2 A of------------, that are free
4 to use, included in the Java
Development
Environment.
Aprewritten Bprewritten
. classes . objects
Cprewritten Dprewritten
. variables . constants
Answer is : A
12 B 24 1 A O Considering the following
0 0 AI 3 BJ
02 A statement, java.util is a
4 package, while Scanner is
a class of
the java.util package. What
is syntax for declaring the
above

import import
A B
java.util.Sc java.Util.Sc
. .
anner; anner;
import import
C D
Java.Util.Sc java.Util.sc
. .
anner; anner;
Answer is : A
12 B 24 1 A O ________is a Java feature
0 0 AI 3 BJ
12 A that allows concurrent
4 execution of two or more
parts of a program for
maximum utilization of
CPU.

AMultitaski BMultiprogra
. ng . mming
CMultithrea DMultiplexin
. ding .g
Answer is : C
12 B 24 1 A O A __________contains
0 0 AI 3 BJ
22 A two or more parts that can
4 run concurrently and each
part can handle a different
task at the same time
making optimal use of the
available resources
specially when your
computer has multiple
CPUs.
Amulti- Bmulti-
threaded threaded
. .
object program
multi- multi-
C D
threaded threaded
. .
class function
Answer is : B
12 B 24 1 A O A new thread begins its
0 0 AI 3 BJ
32 A life cycle in the new state.
4 It remains in this state until
the program starts the
thread. It is also referred to
as a ________
Ajust-born B
dead thread
. thread .
C Drunning
born thread thread
. .
Answer is : C
12 B 24 1 A O By default, every thread
0 0 AI 3 BJ
42 A is given priority
4
NORM_P NORM_P
RIORITY RIORITY
A B
(a (a
. .
constant constant
of 5). of 5).
NORM_P
RIORITY
C D
(a none
. .
constant
of 5).
Answer is : B
12 B 24 1 A O If we extend the Thread
0 0 AI 3 BJ
52 A class, our class cannot
4 extend any other class
because Java doesn’t
support ______

multiple
A B
inheritance inheritanc
. .
e
Chierarchical Dsingle
. inheritance . inheritance
Answer is : B
12 B 24 1 A O Once Thread object is
0 0 AI 3 BJ
62 A created, you can start it
4 by
calling ________metho
d, which executes a call
to _______method.
A thread () Bstart() and
. and run( ) . run()
C start() and Dstart() and
. running() . yield()
Answer is : B
12 B 24 1 A O When does Exceptions in
0 0 AI 3 BJ
72 A Java arises in code
4 sequence?
A Run BCompilation
. Time . Time
Can
C D None of the
Occur
. . mentioned
Any Time
Answer is : A
12 B 24 1 A O Which of these keywords
0 0 AI 3 BJ
82 A is not a part of exception
4 handling?
A B
try finally
. .
C D
thrown catch
. .
Answer is : C
12 B 24 1 A O Which of these keywords
0 0 AI 3 BJ
92 A is not a part of exception
4 handling?
A B
try finally
. .
C D
thrown catch
. .
Answer is : C
12 B 24 1 A O Which of these keywords
1 0 AI 3 BJ
02 A must be used to monitor
4 for exceptions?

A B
try finally
. .
C D
throw catch
. .
Answer is : A
12 B 24 1 A O Which of these keywords
1 0 AI 3 BJ
12 A must be used to handle the
4
exception thrown by try
block in some rational
manner
try
A B
finally
. .
C D
throw catch
. .
Answer is : D
12 B 24 1 A O In which of the following
1 0 AI 3 BJ
22 A package Exception class
4 exist?
A B
java.util java.file
. .
C D
java.lang java.io
. .
Answer is : C
12 B 24 1 A O In a java program, if an
1 0 AI 3 BJ
32 A exception has occurred, the
4 method creates an Object
known as _________and
hands it off to the run-time
system(JVM)
AException BJavaExcepti
. Object . on
C D
JavaCatch javatry
. .
Answer is : A
12 B 24 1 A O For each try block there
1 0 AI 3 BJ
42 A can be ____catch blocks,
4 but _________ finally
block.
zero or two or
A B
more and more and
. .
only one only two
no and
Cany number D
many
. of and no .
number of
Answer is : A
12 B 24 1 A O __________is a special
1 0 AI 3 BJ
52 A type of program that is
4 embedded in the webpage
to generate the dynamic
content.
AJava.Net BJava Applet
. .
C D
JavaInet JavaBeans
. .
Answer is : B
12 B 24 1 A O Which function is used to
1 0 AI 3 BJ
62 A initialize java Applet?
4
Apublic void Bpublic void
. init() . start()
public void
Cpublic void D
appletcode(
. initialize() .
)
Answer is : A
12 B 24 1 A O This method is invoked
1 0 AI 3 BJ
72 A after applet initialization
4
Apublic void Bpublic void
. start() . run()
Cpublic void Dpublic void
. running() . sleep()
Answer is : A
12 B 24 1 A O Which of the following
1 0 AI 3 BJ
82 A method is used to paint the
4 Applet?
public void public void
A B
GraphicsP paint(Gra
. .
aint() phics g)
public void
Cpublic void D
AppletPain
. Graphics() .
t()
Answer is : B
12 B 24 1 A O All applets are sub-classes
1 0 AI 3 BJ
92 A (either directly or
4 indirectly) of_____ class
Ajava.applet. Bjava.Applet
. Applet . .applet
Cjava.io.appl Djava.io.Àpp
. et . let
Answer is : A
12 B 24 1 A O An applet is a Java
2 0 AI 3 BJ
02 A program that can be
4 embedded into a ---------
AappletViewe B
webpage
.r .
Cjavaapplet Dinternet
. .
Answer is : B
12 B 24 1 A O whenever the applet must
2 0 AI 3 BJ
12 A redraw its
4 output, _________ is
called
A B
string() grahics()
. .
C D
paint() pen()
. .
Answer is : C
12 B 25 1 A O This syntax Creates a
2 0 AI 3 BJ
22 A random access file stream
4 to read from, and
optionally to write to, the
file specified by the File
argument.
RandomAcc
RAM(File
AessFile(File B
file, String
. file, String m .
mode)
ode)
RandomAcc
RAM(File
CessFile(File D
f, String S
. f, String S .
mode)
mode)
Answer is : A
12 B 25 1 A O Enterprise Information
2 0 AI 3 BJ
32 A Systems Tier Or Data
4 Tier defines all the
elements that are needed to
communicate
between______.
J2EE
J2EE
application
A Bapplication
and non-
. . and J2EE
J2EE
software
software
both a and
C Da only
b are
. . correct
correct
Answer is : D
12 B 25 1 A O This tier provides
2 0 AI 3 BJ
42 A flexibility to developers of
4 J2EE applications since it
include variety of
resources and support
connectivity to resources.

ENTERPRI
ENTERPRI SE
SE INFORMA
INFORMA TION
ATION BPROCESSI
. SERVICE . NG
TIER OR SYSTEMS
DATA TIER OR
TIER DATA
TIER
ENTERPRI ENTERPRI
SE SE
INFORMA INFORMA
CTION DTION
. SYSTEMS . SYSTEMS
TIER OR TIER OR
DATA DATA
TIER TIER
Answer is : D
12 B 25 1 A O _____________ is
2 0 AI 3 BJ
52 A responsible for low level
4 system services that are
essential for implementing
business logic.

EJB client EJB middle


A B
and EJB and EJB
. .
container container
EJB
EJB server
C Dsystems
and EJB
. . and
container
business
Answer is : C
12 B 25 1 A O EJB tier automatically
2 0 AI 3 BJ
62 A handles concurrency issues
4 that__________

assure
multiple also
clients have manages
A B
simultaneo instances of
. .
us access to component
the same s.
object
Cboth a and Da only
. b correct . correct
Answer is : C
12 B 25 1 A O ___________is a class that
2 0 AI 3 BJ
72 A contains business logic and
4 callable from a servlet or
JSP.

A B
J2EE J2SE
. .
CEnterprise DJava
. java bean . Swing
Answer is : A
12 B 25 1 A O Web tier accepts requests
2 0 AI 3 BJ
82 A from other software that
4 was sent using
_____________operations,
which are part of HTTP
transmissions.
SEND,
POST, RECEIVE
A B
GET, and and
. .
PUT IMPLEMEN
T
BOTH a
C Da only
and b are
. . correct
correct
Answer is : D
12 B 25 1 A O ________ accepts requests
2 0 AI 3 BJ
92 A from other software that
4 was sent using HTTP
transmissions.

A B
Internet tier Web tier
. .
C D
J2EE tier EJB
. .
Answer is : B
12 B 25 1 A O ___________ can access
3 0 AI 3 BJ
02 A components located on
4 tiers other than the tier
where the multi-tier client
resides.

AMulti-tier BMiddle-tier
. clients . clients
CEJB DE2EE
. Clients . Clients
Answer is : A
12 B 25 1 A O __________ can access
3 0 AI 3 BJ
12 A one or more enterprise java
4 beans that are located on
the EJB tier rather than
resources on the web tier.

A B
EJB tier EJB Client
. .
C DEJB
EJB server
. . Aplication
Answer is : B
12 B 25 1 A O It is a java programs that
3 0 AI 3 BJ
22 A interact with the user. It
4 prompts the user for input
and then convert the user’s
response into requests that
are forwarded to software
on a component that
processes the request and
returns results.

AJ2EE BJ2EE
. Client Tier . Server Tier
CJ2EE D
EJB Client
. Middle Tier .
Answer is : A
12 B 25 1 A O Which of the following
3 0 AI 3 BJ
32 A wrapper class converts a
4 object to string

A B
Tostring() toString()
. .
C DWrapperStri
ToString()
. . ng()
Answer is : B
12 B 25 1 A O Which class provides a
3 0 AI 3 BJ
42 A way to use primitive data
4 types as objects

APrimitiveC BWrapperCla
. lasses . sses
CArrayClas DJavaPrimitiv
. ses . eClasses
Answer is : B
12 B 25 1 A O Which of the following is
3 0 AI 3 BJ
52 A the right syntax for
4 importing the Exception
class that can handle Java
Exceptions.

import import
A B
java.io.IOE java.Io.IOe
. .
xception xception
import import
C D
java.io.Ioex java.IO.IOE
. .
ception xception
Answer is : A
12 B 25 1 A O By considering the
3 0 AI 3 BJ
62 A following function .. public
4 void paint(Graphics g)
where g is an
___________

object
class
A Breference of
reference of
. . class
Graphic
Graphic
Memberfun Membervar
Cction of Diable of
. Graphic . Graphic
class class
Answer is : B
12 B 25 1 A O whenever the applet must
3 0 AI 3 BJ
72 A redraw its
4 output, _________ is
called

A B
string() grahics()
. .
C D
paint() pen()
. .
Answer is : C
12 B 25 1 A O An applet is a Java
3 0 AI 3 BJ
82 A program that can be
4 embedded into a ---------

AappletViewe B
webpage
.r .
C D
javaapplet internet
. .
Answer is : B
12 B 25 1 A O All applets are sub-classes
3 0 AI 3 BJ
92 A (either directly or
4 indirectly) of_____ class.

Ajava.Applet Bjava.io.appl
. .applet . et
Cjava.io.Àpp DJava.Applet
. let . .applet
Answer is : A
12 B 25 1 A O J2EE is a _______, built
4 0 AI 3 BJ
02 A on top of the Java SE
4 platform.
cross-
Applied-
A Bplatform
platform
. . technology
technology
core-
CEmbedded D
platform
. technology .
technology
Answer is : B
12 B 25 1 A O What exception is
4 0 AI 3 BJ
12 A thrown when Servlet
4 initialization fails ?

AIOExceptio BServletEx
.n . ception
CRemoteEx D
Exception
. ception .
Answer is : B
12 B 25 1 A O In JSP, how can you
4 0 AI 3 BJ
22 A know what HTTP
4 method (GET or POST)
is used by client
request ?

by using by using
A B
request.ge request.se
. .
tMethod() tMethod()
Cimpossible D
noe
. to know .
Answer is : A
12 B 25 1 A O This function tests whether
4 0 AI 3 BJ
32 A the specified exists or not.
4
A B
isexist() exist()
. .
C D
fileexist() exist(a.txt)
. .
Answer is : B
12 B 25 1 A O This creates an empt file.
4 0 AI 3 BJ
42 A
4
AcreateNew B
createFile()
. File() .
CcreateEmp DcreateNewE
. tyFile() . mptyFile()
Answer is : A
12 B 25 1 A O This tests whether the file
4 0 AI 3 BJ
52 A is readable or not
4
A BcanFileRea
Read()
. . d()
CCouldRead D
canRead()
. () .
Answer is : D
12 B 25 1 A O This returns the name of
4 0 AI 3 BJ
62 A the file
4
AreceiveNa BgetFileNam
. me() . e()
C DreceiveFile
getName()
. . Name()
Answer is : C
12 B 25 1 A O This imports the file class
4 0 AI 3 BJ
72 A
4
import
A Bimport
Java.io.File
. . java.io.File;
;
import
Cimport D
java.IO.File
. java.io.file; .
;
Answer is : B
12 B 25 1 A O The following keyword is
4 0 AI 3 BJ
82 A used with exceptions, a
4 block of code that will be
executed no matter if there
is an exception or not
A B
final finally
. .
C D
noexception try
. .
Answer is : B
1 2 B 2 5 1 A O The following
4 0 AI 3 BJ
92 A keyword Checks whether an
object is an instance of a specific
4
class or an interface
A B
instanceof instance
. .
Cinstanceofo Dinstanceof
. bject . obj
Answer is : A
1 2 B 2 5 1 A O __________Indicates what
5 0 AI 3 BJ exceptions may be thrown by a
02 A method
4
A B
throw throws
. .
C D
thrown throwing
. .
Answer is : B
12 B 21 1 B D List out any five features of
50 AI 3 E java.
12 A S
4 C
12 B 21 1 B D List out some of the
50 AI 3 E commonly used packages by
22 A S java standard library or API.
4 C
12 B 21 1 B D Design and Draw the
50 AI 3 E diagram for layers of
32 A S interaction for a java
4 C program.
12 B 21 1 B D List any 3 examples for Web
50 AI 3 E Browsers and explain
42 A S
4 C
12 B 21 1 B D Show the points that prove
50 AI 3 E java is Platform independent
52 A S and portable
4 C
12 B 21 1 B D Formulate the rules for
50 AI 3 E creating identifiers in Java
62 A S
4 C
12 B 21 1 B D Distinguish between Data
50 AI 3 E Abstraction and Data
72 A S Encapsulation
4 C
12 B 21 1 B D Distinguish between
50 AI 3 E Polymorphism and
82 A S Inheritance
4 C
12 B 21 1 B D Show how Java strongly
50 AI 3 E associated with the Internet
92 A S
4 C
12 B 21 1 B D Distinquish the difference
60 AI 3 E between stand-alone
02 A S application and web-
4 C application.
12 B 22 1 B D Determine what is a
60 AI 3 E constant in java
12 A S
4 C
12 B 22 1 B D Determine what is a
60 AI 3 E Variable?
22 A S
4 C
12 B 22 1 B D List the eight data types
60 AI 3 E used in Java.
32 A S
4 C
12 B 22 1 B D Distinquish the Increment
60 AI 3 E and Decrement Operators.
42 A S
4 C
12 B 22 1 B D Identify the valid and invalid
60 AI 3 E variable names and why? a)
52 A S n3 b) Total Marks c)
4 C first.Name d)float
12 B 22 1 B D Analyze the 3 kinds of Java
60 AI 3 E variables and define them
62 A S
4 C
12 B 22 1 B D With necessary diagram
60 AI 3 E explain different way of exit
72 A S from a loop with break
4 C statement.
12 B 22 1 B D Explain the use of For
60 AI 3 E statement with the Syntax
82 A S
4 C
12 B 22 1 B D Analyze the use of Switch
60 AI 3 E statement ?Write the
92 A S Syntax
4 C
12 B 22 1 B D Determine whether the
70 AI 3 E following statements are
02 A S true or false a) One if
4 C statement can have more
than one else clause b) A
switch statement can be
replaced by a series of
if..else statements. c)
Conditional operator is
trinary operator
12 B 2 3 1 B D State what is an Array. How
70 AI 3 E arrays are used in java?
12 A S
4 C
12 B 2 3 1 B D Discuss how does java
70 AI 3 E handle strings
22 A S
4 C
12 B 2 3 1 B D Explain how to compare two
70 AI 3 E Strings in Java?
32 A S
4 C
12 B 23 1 B D List out the 6 built-in
70 AI 3 E packages in Java?
42 A S
4 C
12 B 23 1 B D Explain how can we create a
70 AI 3 E Thread in Java?
52 A S
4 C
12 B 23 1 B D What is the two-dimensional
70 AI 3 E array? Explain with example
62 A S
4 C
12 B 23 1 B D Define Interface and explain
70 AI 3 E
72 A S
4 C
12 B 23 1 B D Explain single Inheritance
70 AI 3 E with necessary example.
82 A S
4 C
12 B 23 1 B D Define Packages in
70 AI 3 E Java .Summarize the use of
92 A S packages.?
4 C
12 B 23 1 B D Distinquish the difference
80 AI 3 E between equals() method
02 A S and == operator?
4 C
12 B 24 1 B D Illustrate the use of String
80 AI 3 E functions in Java.
12 A S
4 C
12 B 24 1 B D Define a thread in java
80 AI 3 E
22 A S
4 C
12 B 24 1 B D List the two main categories
80 AI 3 E of errors?
32 A S
4 C
12 B 24 1 B D Summarize the points about
80 AI 3 E local and remote applet.
42 A S
4 C
12 B 24 1 B D Justify the difference
80 AI 3 E between exception and error
52 A S in Java?
4 C
12 B 24 1 B D What is an Applet ? Explain
80 AI 3 E
62 A S
4 C
12 B 24 1 B D What are run time exceptions
80 AI 3 E in Java. Give example?
72 A S
4 C
12 B 24 1 B D Define Exception? List out
80 AI 3 E someCommon Java
82 A S Exceptions.
4 C
12 B 24 1 B D List out some of the most
80 AI 3 E common compile-time errors.
92 A S
4 C
12 B 24 1 B D Explain Why an exception
90 AI 3 E occurs in the program?
02 A S
4 C
12 B 25 1 B D List out the categories of
90 AI 3 E Stream Classes in Java. Draw
12 A S its hierarchical diagram.
4 C
12 B 25 1 B D List out the functions of Input
90 AI 3 E Stream Classes in Java.
22 A S
4 C
12 B 25 1 B D List out the functions of
90 AI 3 E Output Stream Classes in
32 A S Java.
4 C
12 B 25 1 B D Draw the hierarchical
90 AI 3 E diagram of Input Stream
42 A S Classes in Java.
4 C
12 B 25 1 B D Illustrate the use of static
90 AI 3 E members and methods.
52 A S
4 C
12 B 25 1 B D Summarize about Random
90 AI 3 E Access File?
62 A S
4 C
12 B 25 1 B D Explain the various file
90 AI 3 E modes in java
72 A S
4 C
12 B 25 1 B D Explain what is awt in java
90 AI 3 E
82 A S
4 C
12 B 25 1 B D Discuss abouthow conditional
90 AI 3 E operator in java can be
92 A S replaced for if else statement
4 C
22 B 25 1 B D Discuss about the method
00 AI 3 E that is used to draw string in
02 A S java graphics
4 C
22 B 21 1 C D Discuss the history of Java.
00 AI 3 E
12 A S
4 C
22 B 21 1 C D With necessary diagram,
00 AI 3 E Explain the structure of Java
22 A S Program.
4 C
22 B 21 1 C D List and explain the various
00 AI 3 E types of tokens supported by
32 A S java
4 C
22 B 21 1 C D Discuss the main features of
00 AI 3 E java.
42 A S
4 C
22 B 2 1 1 C D Discuss about what is a
00 AI 3 E statement in Java and how
52 A S do the java statements differ
4 C from those of C and C++?
22 B 2 1 1 C D Explain with necessary
00 AI 3 E diagram Java Virtual Machine
62 A S
4 C
22 B 2 1 1 C D Compare and Contrast Java
00 AI 3 E with C and C++
72 A S
4 C
22 B 2 1 1 C D Explain what is World Wide
00 AI 3 E Web and the contribution of
82 A S Java to World Wide Web
4 C
22 B 2 1 1 C D How Java interacts with web?
00 AI 3 E Explain with necessary
92 A S diagram.
4 C
22 B 2 1 1 C D List the benefits of OOP and
10 AI 3 E promissing areas for
02 A S application of OOP
4 C
22 B 2 2 1 C D Build a Java Program to print
10 AI 3 E eligibilty to vote using if..else
12 A S statement.
4 C
22 B 2 2 1 C D Explain the three typesof
10 AI 3 E decision making and branch
22 A S statements with necessary
4 C syntax and examples
22 B 2 2 1 C D Explain the three typesof
10 AI 3 E decision making and looping
32 A S statements with necessary
4 C syntax and examples
22 B 2 2 1 C D Build a Java Program to print
10 AI 3 E the factorial of a given
42 A S number
4 C
22 B 2 2 1 C D Discover the special
10 AI 3 E properties of Constructor?
52 A S How do we invoke a
4 C Constructor?
22 B 2 2 1 C D Distinguish between while
10 AI 3 E loop and do..while loop.
62 A S
4 C
22 B 2 2 1 C D Compare and Contrast
10 AI 3 E continue and break
72 A S statement.
4 C
22 B 2 2 1 C D Explain How to create objects
10 AI 3 E and how to access class
82 A S members
4 C
22 B 2 2 1 C D Discuss the various types of
10 AI 3 E Operators.
92 A S
4 C
22 B 2 2 1 C D Design a java program to
20 AI 3 E display biggest of three given
02 A S numbers.
4 C
22 B 2 3 1 C D Construct a Java program to
20 AI 3 E find area of a rectangle using
12 A S inheritance.
4 C
22 B 2 3 1 C D Discuss in detail about life
20 AI 3 E cycle of a thread with
22 A S necessary diagram.
4 C
22 B 2 3 1 C D Discuss about the static
20 AI 3 E members and methods in
32 A S Java
4 C
22 B 2 3 1 C D Recall Inheritance? Illustrate
20 AI 3 E the types of inheritances
42 A S
4 C
22 B 2 3 1 C D Define Multithreading. How
20 AI 3 E to implement multithreading
52 A S
4 C
22 B 2 3 1 C D Discuss about the one-
20 AI 3 E Dimensional and two-
62 A S Dimensional array in Java
4 C
22 B 2 3 1 C D List out and explain any 5
20 AI 3 E commonly used String
72 A S methods.
4 C
22 B 2 3 1 C D Construct a Java Program to
20 AI 3 E throw our own Exception.
82 A S
4 C
22 B 2 3 1 C D Build a Java program to find
20 AI 3 E largest and smallest number
92 A S in an array.
4 C
22 B 2 3 1 C D Construct a java program to
30 AI 3 E implement multilevel
02 A S inheritance concept.
4 C
22 B 2 4 1 C D List out any five HTML Tags
30 AI 3 E with their functions and
12 A S explain
4 C
22 B 2 4 1 C D Discuss about Errors and
30 AI 3 E Exception in Java
22 A S
4 C
22 B 2 4 1 C D Explain lifecycle of an Applet
30 AI 3 E with necessary diagram.
32 A S
4 C
22 B 2 4 1 C D summarize the restrictions
30 AI 3 E imposed on Java applets ?
42 A S
4 C
22 B 2 4 1 C D Construct an applet program
30 AI 3 E to display an image
52 A S
4 C
22 B 2 4 1 C D Develop an Applet code to
30 AI 3 E print HelloJava.
62 A S
4 C
22 B 2 4 1 C D Discuss about graphics
30 AI 3 E programming in java
72 A S
4 C
22 B 2 4 1 C D Discuss about the Commonly
30 AI 3 E used methods of Graphics
82 A S class
4 C
22 B 2 4 1 C D Build a Java Program using
30 AI 3 E try catch block to handle
92 A S exception.
4 C
22 B 2 4 1 C D Build a Java Program to
40 AI 3 E implement multiple catch
02 A S block.
4 C
22 B 2 5 1 C D Discuss about writing and
40 AI 3 E reading bytes in a file.
12 A S
4 C
22 B 2 5 1 C D Construct a java program to
40 AI 3 E display oddnumbers from 1
22 A S to 100
4 C
22 B 2 5 1 C D Build a Java Program using
40 AI 3 E files and explain
32 A S
4 C
22 B 2 5 1 C D Explain about reading and
40 AI 3 E writing characters in afile
42 A S
4 C
22 B 2 5 1 C D Explain how to read and
40 AI 3 E write primitive data in files
52 A S
4 C
22 B 2 5 1 C D Discuss about I/O Exception
40 AI 3 E classes and their functions.
62 A S
4 C
22 B 2 5 1 C D Discuss about random
40 AI 3 E access file in Java
72 A S
4 C
22 B 2 5 1 C D Construct a Java Program to
40 AI 3 E display current date and time
82 A S
4 C
22 B 2 5 1 C D Discuss about labeled breaks
40 AI 3 E and continue in java
92 A S
4 C
22 B 2 5 1 C D Construct a java program to
50 AI 3 E explain the use of switch
02 A S statement
4 C
22 B 2 1 1 E O Which one the following
50 AI 3 BJ
12 A the write syntax to declare
4 main function in java
APublic Bpublic
. static void . Static void
main(String main(String
args[]) args[])

public
Cstatic void Dpublic
. main(string . static void
args[]) main(String
args[])
Answer is : D
22 B 21 1 E O Which of the following is
5 0 AI 3 BJ
22 A the write syntax to print a
4 statement in java
system.out. System.Out
A B
println(“He .println(“He
. .
llo world”); llo world”);
System.out. System.out.
C D
println(“He Println(“He
. .
llo world”); llo world”);
Answer is : C
22 B 21 1 E O Which is the right syntax
5 0 AI 3 BJ
32 A to read a integer varibale in
4 java
breadth=Int breadth=int
Aeger.parseIn Beger.parseIn
. t(in.readLin . t(in.readLin
e()); e());
breadth=Int breadth=Int
Ceger.ParseIn Deger.parseIn
. t(in.readLin . t(in.readline
e()); ());
Answer is : A
22 B 21 1 E O Which of the following is
5 0 AI 3 BJ
42 A the right syntax to declare
4 a reader class in java
DatainputSt DataInputSt
ream ream
Ain=new Bin=new
. DataInputSt . DataInputSt
ream(Syste ream(Syste
m.in); m.in);
DataInputst DataInputSt
ream ream
Cin=new Din=new
. DataInputSt . DataInputSt
ream(Syste ream(syste
m.in); m.in);
Answer is : B
22 B 21 1 E O Which of the following is
5 0 AI 3 BJ
52 A the right syntax for
4 interface
class Class
ABicycle BBicycle
. implements . implements
Vehicle Vehicle
class class
CBicycle DBicycle
. Implements . implement
Vehicle Vehicle
Answer is : A
22 B 21 1 E O Which of the following is
5 0 AI 3 BJ
62 A the right syntax when class
4 ICICI wants to use
errorhandling
Class ICICI class ICICI
extends extends
A B
Exception Exception
. .

class ICICI class ICICI


Extends extend
C D
Exception Exception
. .

Answer is : B
22 B 22 1 E O Which of the following is
5 0 AI 3 BJ
72 A the right syntax to catch
4 error in array index
catch(Array Catch(Array
AIndexOutOf BIndexOutOf
. BoundsExc . BoundsExce
eption e) ption e)
catch(arrayI catch(Array
CndexOutOf DIndexOutOf
. BoundsExc . BoundsExce
eption e) ption E)
Answer is : A
22 B 22 1 E O Which of the following is
5 0 AI 3 BJ
82 A the right syntax for using
4 applet class
APublic class Bpublic
. appshape . Class
extends appshape
extends
Applet
Applet
public class public class
Cappshape Dappshape
. extends . extends
Applet applet
Answer is : C
22 B 22 1 E O Which of the following is
5 0 AI 3 BJ
92 A the right syntax to draw
4 rounded rectangle

g.drawRoun g.drawroun
AdRect(200,3 BdRect(200,3
. 60,100,50,1 . 60,100,50,1
0,10); 0,10);
g.drawRoun g.drawRoun
Cdrect(200,36 DdRect(200,3
. 0,100,50,10, . 60,100,50,1
10); 0);
Answer is : A
22 B 22 1 E O Which of the following is
6 0 AI 3 BJ
02 A right syntax for input
4 output exception
ACatch(IOEx Bcatch(IoEx
. ception e) . ception e)
Ccatch(IOexc Dcatch(IOEx
. eption e) . ception e)
Answer is : D
22 B 22 1 E O Which of the following is
6 0 AI 3 BJ
12 A the right syntax to stop the
4 immedietely
ASystem.exi Bsystem.exit(
. t(-1); . -1);
CSystem.Exi DSystem.Eex
. t(-1); . it();
Answer is : A
22 B 22 1 E O Which of the following is
6 0 AI 3 BJ
22 A the right syntax for
4 declaring file in java
AFileInputSt BFileinputStr
. ream infile . eam infile
CFileInputstr DFileInputStr
. eam infile . eams infile
Answer is : A
22 B 23 1 E O
6 0 AI 3 BJ
32 A
4 Which of the following is
the bundles of fundamental
classes?
A B
java.lang java.io
. .
C D
java.Lang java.IO
. .
Answer is : A
22 B 23 1 E O There can be only
6 0 AI 3 BJ
42 A _______statement in
4 each source file, and it
applies to all types in the
file.
Aone Btwo
. package . package
any
Cno D
number of
. package .
package
Answer is : A
22 B 23 1 E O If a class wants to use
6 0 AI 3 BJ
52 A another class in the
4 same package, the
package name
______used.
Aneed not Bcompulsaril
. be . y used
Cneed to Doptionally
. be .
Answer is : A
22 B 23 1 E O
6 0 AI 3 BJ
A class can have
62 A _______, as long as
4
their parameters are
not the same
only one two
A B
.
construct .
construct
ors ors
multiple no
C D
.
construct . construct
ors ors
Answer is : C
22 B 23 1 E O
6 0 AI 3 BJ public class MyClass {
72 A
4

private int number


= 0;

public MyClass() {
}

public MyClass(int
theNumber) {
this.number =
theNumber;
}
}

The above java pgm


contains how many
constructors?
two
Aonly one B
constructor
. constructor .
s
no this
C D
constructor constructor
. .
s s
Answer is : B
22 B 23 1 E O
6 0 AI 3 BJ
82 A
4 The _________ indicates
that you are making a new
class that derives from an
existing class.
A B
inherits extends
. .
C D
derives implements
. .
Answer is : B
22 B 24 1 E O create objects (to access it,
6 0 AI 3 BJ
92 A it must be inherited from
4 another class)

Arestricted Binherited
. class . class
Abstract
Cclass Dprotected
. . class

Answer is : C
22 B 24 1 E O An _______ is a special
7 0 AI 3 BJ
02 A "class" that represents a
4 group
of constants (unchangeable
variables,
like final variables)
Afinal Bunchangeab
. . le
Cspecial Denum
. .
Answer is : D
22 B 24 1 E O What would be the results
7 0 AI 3 BJ
12 A of compiling and running
4 the following class. Select
the one correct answer.

class test {

public static void main() {

System.out.println("test");
}}

The
The
program
program
does not
compiles
compile as
and runs
Athere is no B
generating
. main .
an output
method
of "test"
defined.

The
program
The
compiles
program
and runs
compiles
Cbut does D
but does
. not .
not run.
generate
any output.

Answer is : D
22 B 24 1 E O
7 0 AI 3 BJ
22 A
int i = 0;
4
while (i < 5) {
System.out.print(i)
;

i++;

What is output for the


following pgm jist
Aprints 0 1 2 B
prints 0
. 34 .
C D
syntax error prints 1
. .
Answer is : A
2 2 B 2 4 1 E O public class MyClass {
7 0 AI 3 BJ public static void
32 A main(String[] args) {
4 int i = 0;
do {

System.out.println(i);
i++;
}
while (i < 5);
}}

Aprints 0 1 2 B prints 0 1
. 345 . 234
C prints 1 2 3 D prints 1 2
. 45 . 345
Answer is : B
2 2 B 2 5 1 E O in = new
7 0 AI 3 BJ FileInputStream("input
42 A .txt");out = new
4 FileOutputStream("outp
ut.txt");
what can you
understand by seeing
the above two
statements?

input.txt
output.txt is
is opened
A B opened for
for
. . writing
reading
purpose
purpose
both a and b
both a and
C Dare told in
b are
. . writing/read
correct
ing purpose
Answer is : C
22 B 25 1 E O ______is a portable,
7 0 AI 3 BJ
52 A platform-independent
4 model written in Java
Programming Language.

JavaSwing
A B
JavaInet
. .
C D
J2EE JavaBeans
. .
Answer is : D
22 B 25 1 E O JavaBeans
7 0 AI 3 BJ
62 A are classes which
4 encapsulate
several objects into a
_____.

Asingle Bmultiple
. object . object
Cinherited Dimplicit
. object . object
Answer is : A
2 2 B 2 5 1 E O _____premier platform for
7 0 AI 3 BJ rapidly developing and
72 A
deploying secure,
4
portable applications that
run on server and
desktop systems
spanning most operating
systems
A B
JAVA J2SE
. .
CJAVABEAN D
J2EE
.S .
Answer is : B
2 2 B 2 5 1 E O class abc
7 0 AI 3 BJ {
82 A public static void
4 main(String args[])
{

if(args.length>0)

System.out.println(arg
s.length);
}} WHAT IS OUTPUT
FOR THE ABOVE CODE
JIST?

compiles, compiles,
A B
runs and runs and
. .
prints 0 prints 1
compiles
and runs
C does not D
but does
. compile .
not print
anything
Answer is : D
2 2 B 2 5 1 E O public class abc
7 0 AI 3 BJ {
92 A static public void
4 main(String [] xyz)
{
for(int
n=1;n<xyz.length; n++)
{

System.out.println(xyz
[n]+""); } } }
WHAT IS THE OUTPUT FOR
THE ABOVE CODE

A B
12 23
. .
C DCOMPILATI
123
. . ON ERROR
Answer is : B

You might also like