Sie sind auf Seite 1von 6

[2 In Multithreaded programming, when we create a thread object it is said to be in what

7] state
Choice a

running

Choice b

newborn

Choice c

dead

Choice d

blocked

[2 Which of the following step is invalid for creating a package


6]
Choice a

Declare the package in beginning of


the file

Choice b

Define the classes to be put in the


package & declare it public

Choice c

Create the listing as java in the


Subdirectory by package menu

Choice d

Execute this java file

[22] The size of array in java is stored in


Choice
a

Variable length

Choice
b

Variable len

Choice
c

Methods length

Choice
d

Method len
[20] What is wrong in the following code
abstract class print
{
abstract show();
}
class display extends print
{
}

Choice
a

Nothing is wrong

Choice
b

Method show() should have a return type

Choice
c

Method show() is not implemented in class display

Choice
d

class display does not contain anything

[19] What keyword can protect a class in a package from accessibility by the
classes outside the package
Choice
a

private

Choice
b

protected

Choice
c

public

Choice
d

default (also without using this keyword)

[1 What line numbers will cause an error when you compile this code
4] 1 class iftest
2 {
3 public static void main(String args[])
4 {
5 int i=2;
6 if(i=2) {
7 System.out.println(Correct); }
8 else
9 System.out.println(Incorrect); }
10 }
11 }
Choice a

5,9,10

Choice b

6,9

Choice c

Choice d

9,10

[13] Which of the following is True with respect to branching statements if &
switch
Choi
ce a

every if statement can be written using switch

Choi
ce b

every switch statement must have a default case

Choi
ce c

every case must end with a break statement

Choi
ce d

every case label follows with a(:) colon

[11] What is the value of the expression Math.floor(1.567)


Choice a

1.6

Choice b

Choice c

Choice d

1.5

[10] What is a value of the expression 5%3


Choice a

Choice b

Choice c

Choice d

[9] What is FALSE with respect to variable in Java


Choice
a

A variable must be declared before it is used in the program

Choice
b

A variable can be used to store any data type

Choice
c

The place of declaration decides the scope of the variable

Choice
d

A variable name must be maximum 10


[8] What is process of converting one data type to
another
Choice a

Converting

Choice b

Changing

Choice c

Defining

Choice d

Casting

characters long

[6] To print string on the


screen we use
System.out.println. What
is the correct
explaination for this

Choi
ce a

System is a
class.println is
a method and
out is a object

Choi
ce b

System is a
Object.out is a
object and
println is data
member

Choi
ce c

System is a
package out is
a method print
is a object

Choi
ce d

System is a
pointer to
object out of
class println
5] Which of the
following is NOT
true with respect to
Java Program
Structure
Choi
ce a

Comme
nts can
be
given
only at
the
beginni
ng of
Progra
m

Choi
ce b

Package
stateme
nt
should
be
before
class
definiti
on

Choi
ce c

Import
stateme
nt
should
be
before

class
definiti
on
Choi
ce d

Interfac
e
stateme
nt
should
be
before
class
definiti
on

[4] Java is Multithreaded


Language, What
Statement best explains
this feature
Choi
ce a

Java
application
need not
wait for the
application
to finish
one task
before
beginning
another

Choi
ce b

Java is
capable of
dynamicall
y linking in
U class
libraries,
methods
and objects

Choi
ce c

Java
supports
functions
written in
other
languages
such as C
and C++

Choi
ce d

Java uses
less amount
of memory
in

environmen
t
[3] Which of the following is NOT one of the web
browsers
Choice a

Coldjava

Choice b

Netscape
Navigator

Choice c

Internet Explorer

Choice d

Hotjava

[2] In OOP process by which objects of one class


acquire the properties of objects of another
class is
Choice a

Inheritance

Choice b

Polymorphis
m

Choice c

Encapsulation

Choice d

Abstraction

[1] In OOP approach programs are divided into


Choice a

Objects

Choice b

Method
s

Choice c

Functio
ns

Choice d

Procedu
res

Das könnte Ihnen auch gefallen