You are on page 1of 43

[1] Which exception may be thrown if the given code is executed giving 2 integer

runtime arguments
class sample
{
public static void main(String args[])
{
try
{
int a=Integer.parseInt(args[0]);
int b=Integer.parseInt(args[1]);
int c = a + b;
System.out.println("Sum is "+c);
}
catch(ArithmeticException ae)
{ System.out.println("Arithmetic Exception "+ae.getMessage()); }
catch(NumberFormatException ne)
{ System.out.println("Number Format Exception "+ne.getMessage()); }
catch(Exception e)
{ System.out.println("Exception "+e); }
}
}
Choice a
ArithmeticException
Choice b
NumberFormatException
Choice c
Exception
Choice d
None of the above
[2] In Java, when a run-time error occurs which of the following may happen
Choice a
compiles successfully
Choice b
produces wrong output
Choice c
abnormal termination

Choice d
All of the above
[3] In Java, which Exception type is caused by an attempt to access a nonexistent file
Choice a
FileNotFoundException
Choice b
IOException
Choice c
InvalidFileException
Choice d
IOException
[4] In Multithreaded programming, which method is used to transfer control to another
thread of equal priority before its turn comes
Choice a
yield()
Choice b
resume()
Choice c
wait()
Choice d
notify()
[5] To create a package what is the first statement included?
Choice a
import java.aw+.*;
Choice b
package
Choice c
public
Choice d

Class
[6] Which of the following step is invalid for creating a package
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
[7] The following statements create what type of inheritance if class B and class C are
Base classes
class A extends B extends C
{

}
Choice a
Single Inheritance
Choice b
Multilevel Inheritance
Choice c
Multiple Inheritance
Choice d
Hierarchical Inheritance
[8] What keyword is used to inherit an interface
Choice a
extends
Choice b
implements
Choice c

inherits
Choice d
Contains
[9] Which String method is used to compare 2 strings considering any case
Choice a
equals
Choice b
equalto
Choice c
equalsIgnoreCase
Choice d
equalscase()
[10] Which of the following is possible using Vector class
Choice a
It is used to store objects
Choice b
It can store objects that may vary in size
Choice c
It is possible to add & delete
Choice d
All of Three
[11] In method declaration statements, which of the following is optional
Choice a
Method name
Choice b
Return type, Parameter list and body of method
Choice c
Parameter list
Choice d

Body of the method


[12] Which of the following form of Inheritance one dervied class is derived from a
derived class.
Choice a
Single Inheritance
Choice b
Multilevel Inheritance
Choice c
Hierarchical Inheritance
Choice d
Multiple Inheritance
[13] An expression using operators && and || used to combine two or more relational
statement is called
Choice a
combined expression
Choice b
relational expression
Choice c
logical expression
Choice d
boolean expression
[14] Identify line numbers where logical errors occur in the following code so that
factorial of 5 is calculated.
1 class factorial
2{
3 public static void main(String args[])
4{
5 int n=0,fact=0;
6 for(int n=0;n>=1;n--)
7 fact=fact*1;
8 System.out.println(Factorial of 5 is +fact);
9}
10 }
Choice a
lines 5,6

Choice b
lines 6
Choice c
lines 7
Choice d
lines 5,6,7
[15] Which of the following portion specified in the for loop is compulsary
Choice a
initialization
Choice b
test condition
Choice c
increment
Choice d
All of the above
[16] Consider the following program code. state the output from it
class ifif
{
public static void main(String args[])
{
int x=3, y=1,z=5;
if(x>y)
{
if (z<=y)
{
System.out.println(y is greater than z);
}
else
{
System.out.println(z is greater than y);
}
System.out.println(x is greater than y);
}
else
{
if(y>z)
{

System.out.println(y is greater than z);


}
}
}
}
Choice a
z is greater than y
x is greater than y
Choice b
y is greater than z
x is greater than y
Choice c
x is greater than y
x is greater than z
Choice d
x is greater than y
z is greater than y
[17] What will be the output of the following code segment
n=5;
r=n%3;
if (r == 0)
System.out.println(zero);
else
if (r ==1)
System.out.println(one);
else
if (r == 2)
System.out.println(two);
else
System.out.println(three);
Choice a
zero
Choice b
one
Choice c
two
Choice d

Three
[18] Which of the following is True with respect to branching statements if & switch
Choice a
every if statement can be written using switch
Choice b
every switch statement must have a default case
Choice c
every case must end with a break statement
Choice d
every case label follows with a(:) colon
[19] 3. What is the result if the code of statements are executed
int result = (2*(5-8)*(5-5)+10)*2;
Choice a
8
Choice b
20
Choice c
14
Choice d
0
.
[21] What is the value of the expression a<b||b<a if a is 2 and b is 1
Choice a
1
Choice b
2
Choice c
0
Choice d
TRUE

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


Choice a
1.6
Choice b
1
Choice c
2
Choice d
1.5
[23] Which of the following is NOT one of the classification of Java variables
Choice a
Instance variables
Choice b
block variables
Choice c
class variables
Choice d
local variables
[24] Which of the following is a primitive Data type in Java
Choice a
Character
Choice b
Classes
Choice c
Arrays
Choice d
Interface
[25] What will be the output of the following code, if executed with command line
arguments as follows
java cmdline Java is wonderful

class cmdline
{
public static void main(String args[])
{
for(int i=1;i<args.length;i++)
{
System.out.print(args[i]);
if(i!=args.length)
System.out.print( );
}
System.out.println();
}
}
Choice a
Java
Choice b
Java is
Choice c
is wonderful
Choice d
cmdline Java is wonderful
[26] Which of the following is a Java keyword
Choice a
String
Choice b
super
Choice c
Mod
Choice d
Exception
[27] Which of the following is NOT a Java keyword
Choice a
throws

Choice b
try
Choice c
while
Choice d
Exception
[28] Which of the following feature of C++ is NOT supported by Java and is therefore
implemented using interfaces
Choice a
Nested Classes
Choice b
Inner Classes
Choice c
Polymorphism
Choice d
Multiple Inheritance
[29] Java is Platform-independent, What statement explain this feature
Choice a
Java programs can be easily moved from one computer system to another
Choice b
Java systems verify memory access and virus
Choice c
Java can be used to create applications on the networks
Choice d
It provides many safeguards to ensure reliable code
[30] In OOP approach programs are divided into
Choice a
Objects
Choice b

Methods
Choice c
Functions
Choice d
Procedures
[31] OOP treats what as a critical element in program development and does not allow it
to flow freely around the system.
Choice a
Procedures
Choice b
Action
Choice c
Data
Choice d
Method
[32]

In Multithreaded programming, when we create a thread object it is said to be


in what state
Choice a
Choice b
Choice c
Choice d
[33] The size of array in java is stored in

Choi
ce a

Variable length

Choi
ce b

Variable len

Choi
ce c

Methods length

running
newborn
dead
blocked

Choi
ce d

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

Choi
ce a

Nothing is wrong

Choi
ce b

Method show() should have a return type

Choi
ce c

Method show() is not implemented in class display

Choi
ce d

class display does not contain anything


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

Choi
ce a

private

Choi
ce b

protected

Choi
ce c

public

Choi
ce d

default (also without using this keyword)

[36] What line numbers will cause an error when you compile this code
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 }

5,9,1
0

Choice a

6,9

Choice b

Choice c

9,10

Choice d
[36] What is a value of the expression 5%3
Choice a
Choice b
Choice c
Choice d

2
1
0
3

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


Cho
ice a

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

Cho
ice b

A variable can be used to store any data type

Cho
ice c
Choice d

The place of declaration decides the scope of the variable


A variable name must be maximum 10 characters long

[38] What is process of converting one data type to another


Cho
ice a

Converting

Cho
ice b

Changing

Cho
ice c

Defining

Cho
ice d

Casting

[39] To print string on the screen we use System.out.println. What


is the correct explaination for this

Cho
ice a

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


object

Cho
ice b

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


member

Cho
ice c

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

Cho
ice d

System is a pointer to object out of class println


[41]

Java is Multithreaded Language, What Statement best


Which
of the
explains this
feature
[40]
following is NOT
Java
application
need not wait for the application to
true
with respect
Choice a
finish
one task
before beginning another
to Java
Program
Structure
Java
is capable of dynamically linking in U class
Choice b
libraries,
and objects
Comment
C methods

s can
be
Java hoi
supports
functions
written in other languages
given
such ce
as C and
C++
only at
a
Java uses less amount of memory in environment
the
Choice d
beginnin
g of
[42] Which of the following is NOT
Program
one of the web browsers
Choice c

Choice a C
hoi
Choice b ce
b
Choice c

Package
statement
should be
before
class
definition

Coldjava
Netscape Navigator
Internet Explorer

Import
C
Hotjava
Choice d hoi statement
should
be
ce
[43] In OOP process bycwhichbefore
objects of one class acquire the
class
properties of objects of another class is
definition
Inheritance
Choice a
Interface
C
hoi statement
Polymorphism
Choiceceb
should be
before
d
class
Encapsulation
Choice c
definition
Choice d

Abstraction

[44] In, Java Exception handling code what could be done in the finally block
Choice a
It is used to write initialization code
Choice b
It can be used to perform house-keeping operations
Choice c
It can be used to catch all exceptions
Choice d
It can be used to ignore all exceptions
[45] In Java, what is a condition that is caused by a run-time error in the program
Choice a
validity
Choice b
exception
Choice c
error
Choice d
Action
[46] In Multithreaded programming, the process of assigning time to thread is known as
Choice a
timing
Choice b
processing
Choice c
time-slicing
Choice d
Assigning
[47] What classes does the Java system package java.util contain
Choice a

Classes for primitive types,Strings,Math functions, Threads and Exceptions


Choice b
Classes such as Vectors, hash tables, random numbers, date etc
Choice c
Classes for Input/Output support
Choice d
Classes for implementing graphical user interface
[48] What form of Inheritance is not supported by Java
Choice a
Single
Choice b
Multilevel
Choice c
Multiple
Choice d
Hierarchical
[49] Which of the following is NOT a method of string class
Choice a
valueOf
Choice b
append
Choice c
CharAt
Choice d
indexOf
[50] What statement would better explain what are wrapper classes
Choice a
Wrapper classes convert primitive datatypes into object types
Choice b

Wrapper classes convert objects to primitive data types


Choice c
Wrapper classes are used to store list of objects that may vary in size
Choice d
Wrapper classes are used to convert any class type into array type object
[51] When a method with same return type and a method with same name
and arguments is defined in Super class as well as subclass. If the
method in the subclass is invoked instead of the super class method,
what is this concept known as
Choic
ea

Inheritance

Choic
eb

Method Overriding

Choic
ec

Method Overloading

Choic
ed

Final Method

[52] Which of the following visibility modifiers allows widest visibility and is accesible
everywhere
Choice a
private
Choice b
Protected
Choice c
Public
Choice d
Friendly
[53] What is valid for abstract classes and abstract methods
Choice a
We cannot use abstract classes to instantiate objects.
Choice b
abstract methods of an abstract class must be defined in its subclass.

Choice c
Constructers cannot be declared abstract
Choice d
All of the above
[54] What will be the output of the following code segment
int r=20;
while(r>0)
{
r=r-10;
if(r>0)
continue;
System.out.print("r is "+r);
}
Choice a
r is 10
Choice b
r is 0
Choice c
r is 20
Choice d
r is 20 r is 10
[55] Which of the following looping constructs body, will execute at least once even if
the condition is false.
Choice a
for
Choice b
do
Choice c
while
Choice d
none of the above.

[56] What will be the output of the following code segment


int a,b;
a=2;
b=5;
if(a>2)
if(b>2)
{
System.out.print(b is +b);
}
else
System.out.print(a is +a);
Choice a
a is 2
Choice b
b is 5
Choice c
a is 2 followed by b is 5
Choice d
No output
[57] Which of the following statements do not fall in selection statement
category
Choice a
Choice b
Choice c
Choice d

if statement
switch statement
conditional operator statement
for construct statement

[58] What will be the output of the following program code


class sample
{
public static void main(String args[])
{
int x=10;
int y=15;
System.out.print(x>y?4:3);

}
}
Choice a
3
Choice b
4
Choice c
10
Choice d
15
[59] Which of the following operators have lowest precedence
Choice a
unary operators
Choice b
binary operators
Choice c
bitwise operators
Choice d
logical operators
[60] Which of the following are Integer types in Java
Choice a
Byte
Choice b
Long
Choice c
Short
Choice d
All of the options 1,2,3
[61] Which of the following is NOT one of the valid escape sequence available for use in
Java

Choice a
\b
Choice b
\n
Choice c
\m
Choice d
\t
[62] Which of the following type of Programs can be developed in Java
Choice a
Standalone applications
Choice b
Web applets
Choice c
Both Option1and Option 2
Choice d
Neither Option1and Option 2
[63] JDK stands for
Choice a
Java Display Kit
Choice b
Java Direct Kit
Choice c
Java Debugger Kit
Choice d
Java Development Kit
[64] Dynamic binding is associated with
Choice a
Polymorphism

Choice b
Inheritance
Choice c
Both Option1 and Option2
Choice d
Neither Option1 and Option2
[65] In OOP, the concept of Polymorphism is
Choice a
Reusability
Choice b
Ability to take more than one form
Choice c
Sharing of data
Choice d
Hiding of data
[66] In Java when a compile-time error occurs, then which file is NOT created
Choice a
source
Choice b
.java
Choice c
.class
Choice d
.exe
[67] Which of the following is a run-time error
Choice a
Missing semicolons
Choice b
Dividing an integer by zero

Choice c
Use of undeclared variables
Choice d
Missing of brackets
[68] In Multithreaded programming, what is the constant numeric value used for setting
lowest priority for Threads
Choice a
1
Choice b
5
Choice c
4
Choice d
10
[69] What does the following import statement actually mean import java.awt.*;
Choice a
import awt class from the java package
Choice b
Import all variables from awt class
Choice c
Import all the classes from the awt package contained in the java package
Choice d
Import all the classes from the java package
[70] Java does not support Multiple Inheritance. What is an alternative approach provided
to implement this
Choice a
Packages
Choice b
Interfaces

Choice c
Collections
Choice d
Wrapper classes
[71] The method insert() is a method used with
Choice a
Arrays
Choice b
Strings
Choice c
StringBuffers
Choice d
Vectors
[72] What is the error in the following class definition
abstract class sample
{
abstract calc(int a) { }
}
Choice a
class header is not defined properly
Choice b
constructor is not defined
Choice c
method calc is not defined properly
Choice d
No error
[73] What is valid for static methods
Choice a
They can only call other static methods.
Choice b

They can only access static data.


Choice c
They cannot refer to this or super
Choice d
All of the above
[74] Which of the following keywords cannot be used to control access to a class member
Choice a
interface
Choice b
abstract
Choice c
public
Choice d
Protected
[75] What will be the output of the following code segment
int m = 100;
int n =103;
while(++m<=--n);
{
System.out.print(m);
}
Choice a
102
Choice b
101
Choice c
103
Choice d
100
[76] What is the process of assigning a smaller type to a larger one with respect to type
conversion

Choice a
casting
Choice b
Promotion
Choice c
narrowing
Choice d
implicit
[77] Which of the following is essential part of a Java Program
Choice a
Packet statement
Choice b
Import statement
Choice c
Class definitions
Choice d
Main method class
[78] Which of the following is NOT a valid documentation comment used in Java
Choice a
//
Choice b
\\
Choice c
/* */
Choice d
/** */
[79] What was Java originally called as
Choice a
Object C

Choice b
Object Basic
Choice c
Oak
Choice d
Pascal
[80] Which of the following feature in C is NOT included in Java
Choice a
Break statement
Choice b
Continue statement
Choice c
Pointer type
Choice d
Primitive data types
[81] In Java, the task of handling the run-time errors and continue
executing the remaining progam is known as
Choice
a

hitting

Choice
b

throwing

Choice
c

catching

Choice
d

exception handling

[82] In Multithreaded programming, which method is used to take the


thread to premature dead state
Choice
a

pre()

Choice
b

dead()

Choice
c

stop()

Choice
d

pause()

[83] What classes does the Java system package java.awt contain
Choice
a

Classes for primitive types,Strings,Math functions, Threads and


Exceptions

Choice
b

Classes such as Vectors, hash tables, random numbers, date etc

Choice
c

Classes for Input/Output support

Choice
d

Classes for implementing graphical user interface

[84] What is TRUE about nested methods


Choi
ce a

They can be called using object of the class

Choi
ce b

They can be called by giving its name, by another method


of the same class where created.

Choi
ce c

They can be called by giving its name, by another method


of any class.

Choi
ce d

They can be called using classname followed by dot, then


the methodname

[85] What is NOT TRUE about static variable


Choi
ce a

There are created by giving keyword static.

Choi
ce b

only one copy of static variable is created for all


instances of class.

Choi
ce c

It must be accessed using object of class

Choi
ce d

These are referred to as class variables.

[86] What will be the output of the following code segment


int r=100;
while(true)
{
if(r<10)
break;
r=r-10;
}
System.out.print(r is +r);

Choic
ea

r is 0

Choic
eb

r is 10

Choic
ec

r is 100

Choic
ed

r is -10

[87] What is the value of ans if the code of statements are executed
int i = 42+45-48-5;
int j = 5+5-8+2;
int ans = i%j;
2

Choice a

Choice b

Choice c

3
4

Choice d

1
2

[88] What is the value of the expression Math.pow(4,3)


Choice a

Choice b

Choice c

Choice d

[89] What is the value of the expression Math.round(1.567)


Choice
a

Choice
b

Choice
c

1.6

Choice
d

1.67

12

16

64

[90] Which of the following is NOT a valid assignment statement


Choice a

Choice b

Choice c

Choice d

a=b=c=0;

a='a'

0=b;

c=72.25

[91] What should be the source filename of a Java file


Choic
ea

Any name

Choic
eb

name matching any class name present in source file

Choic
ec

name matching the first class name in the source file

Choic
ed

name of the class containing the main method

[92] What is HotJava


Choic
ea

It is first program written in Java and is web browser

Choic
eb

It is applet to run a browser

Choic
ec

It is network application to run applets

Choic
ed

It is program that can edit applets

[93] Java is Extensible 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 dynamically 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 environment

[94] What are user define data types and behave like built-in types of a
programming language.
Choice
a

Objects

Choice
b

Methods

Choice
c

Templates

Choice
d

Classes

[95] In OOP, the concept of Inheritance provides us with


Choice
a

Insulation

Choice
b

Linking

Choice
c

Reusability

Choice
d

Sharing

[96] In Multithreaded programming, which method is used to return the threads to


runnable state from the wait state
Choice a
notify()
Choice b
resume()
Choice c
start()
Choice d
Runnable()
[97] What can interfaces contain?
Choice a

Methods
Choice b
Variables
Choice c
classes
Choice d
Both 1 & 2
[98] What value is returned by the compareTo() String method if the 2
strings compared are equal
Choic
ea

Choic
eb

Choic
ec

TRUE

Choic
ed

-1

[99] What will be displayed as output if S1 contains word "Java" with method
S1.indexOf('a')
Choice a
4
Choice b
2
Choice c
Choice d
3
[100] The concept of inheritance is implemented in Java by
Choice a
creating more than one class
Choice b
extending two or more classes

Choice c
extending one class and implementing one or more interfaces
Choice d
importing classes from packages
[101] What line numbers will cause an error when you compile this code
1 class chknum
2 {
3 public static void main(String args[])
4 {
5 int n=3;
6 switch(n);
7{
8 case 0 : System.out.print(No is 0);
9 case 1 : System.out.print(No is 1);
10 case 2 : System.out.print(No is 2);
11 case 3 : System.out.print(No is 3);
12 case 3 : System.out.print(Other Number);break;
13 } } }
Choice a
Lines 3,7,8,9,10,11
Choice b
Lines 6,8,9,10,11,12
Choice c
Lines 7,10,11
Choice d
Lines 11,12
[102] Which of the following statements do not fall in selection statement category
Choice a
if statement
Choice b
switch statement
Choice c
conditional operator statement

Choice d
for construct statement
[103] What is the output of the following program code
class check
{
public static void main(String args[])
{
boolean b=true;
System.out.println("False");
if(!b) return;
System.out.println("True");
return;
}
}
Choic
ea

True

Choic
eb

False

Choic
ec

False True

Choic
ed

Error

[104] What will be the value of b if a=2 and given the expression b=a++;
Choice a
0
Choice b
1
Choice c
2
Choice d
3
[105] What type of value will the expression (a%b) return where, a=10 and b=7.
Choice a
7

Choice b
1
Choice c
int
Choice d
float
[106] Which of the following is valid rule to create Java Identifier names
Choice a
It can contain digits, alphabets, dollar symbol and underscore
Choice b
It cannot start with a underscore
Choice c
It cannot contain uppercase letter
Choice d
It can start with a digit
[107] Which of the following is NOT one of the jump statements not available in Java
Choice a
goto
Choice b
break
Choice c
continue
Choice d
Return
[108] Which of the following C++ feature is NOT included in Java
Choice a
Multilevel inheritance
Choice b

Inner classes
Choice c
Multithreading
Choice d
Operator overloading
[109] What does message passing involve in OOP
Choice a
It involves specifying name of the object
Choice b
It involves name of the method
Choice c
It involves the information to be sent
Choice d
All of the options 1,2,3
[110] What is valid statement to import only the class color from the awt package
contained in the java package
Choice a
Choice b
Choice c
Choice d
[111]

awt.java.*;
awt.java.color;
java.awt.color;
java.awt.*;

Which of the following are similar to the Static final constants

Choic
ea

Annotations

Choic
eb

Vectors

Choic
ec

Enumerated types

Choic
ed

Object types

[112] What keyword is used to inherit an interface


Choice a
Choice b
Choice c
.

choice d

extends
implements
inherits
contains

[113] Which of the following form of Inheritance has one super class and many
subclasses.
Choice a
Choice b
Choice c
Choice d

Single Inheritance
Multilevel Inheritance
Hierarchical Inheritance
Multiple Inheritance

[114] What is the result if the code of statements are executed


class swtest
{
public static void main(String args[])
{
char ch=i;
switch(ch)
{
case a :
case e :
case i : System.out.println(It is a vowel);
case o :
case u : System.out.println(It is a vowel);break;
default : System.out.println(It is a consonant);
}
}
}

No output

Choice a

It is a vowel

Choice b

It is a consonant

Choice c

It is a vowel
It is a vowel

Choice d
[115] What is the value of Math.rint(1.999)

Choice a

Choice b

Choice c

1.9

Choice d

[116] Which of the following it NOT a valid character constant


Choice a
Choice b
Choice c
Choice d

x
1
a
;

[117] Java is Robust, What statement explain this feature


Choi
ce a

Java programs can be easily moved from one computer


system to another

Choi
ce b

Java systems verify memory access and virus

Choi
ce c

Java can be used to create applications on the networks

Choi
ce d

It provides many safeguards to ensure reliable code

[118] Which of the following is NOT True with respect to OOP


Choice
a

Upgrading systems is difficult

Choice
b

Multiple objects co-exists without any interference

Choice
c

Secure Programs can be built

Choice
d

Software development is made easy

[119] API stands for

[120]

Choic
ea

Applet Program Internet

Choic
eb

Application Package Information

Choic
ec

Abstract Programming Interface

Choic
ed

Application Programming Interface

What is the right method of specifying the main method in Java


Choice a
Choice b
Choice c
Choice d

private main (String args[])


public static int main(String args[])
public static void main (String args[])
public void static main (String args[])

[121] What is the value of the expression abs(1)


Choice a
Choice b

1
-1

Choice c

11

Choice d

[122] What is the value of result if the code of statements are


executed
int result = 42+45-48-5-15+20*2;
59

Choice a

68

Choice b

146

Choice c

134

Choice d

[123] How is it possible to make it compulsory that a method is redefined in a subclass


By making a class private

Choice a

By making a class abstract

Choice b

By making the class final

Choice c

By making the class virtual

Choice d

[124] Which of the following String methods is used to give the nth
character of the string
Choice a
Choice b
Choice c
Choice d

substring
replace
charAt(n)
indexOf (n)

[125] In the Interface definition what is TRUE for method declaration

List of methods declaration is only done

Choice a
Choice b

Only one Method declaration can be done

Choice c
Choice d

[126
]

Method declaration as well as body

Only one Methods body is allowed

In Multithreaded programming, what is to be done to return the threads to


runnable
state from sleep() mode
calling method notify()

Choice a

calling method resume()

Choice b

calling method start()

Choice c

nothing but, let the specified time be elapsed

Choice d
[127]

The class Exception is a subclass of which class


Choice a
Choice b
Choice c
Choice d

Object
Throwable
Thread
Throw

[128 In Java, which Exception type is caused by general I/O failures such as unable to
]
read from a file
Choice a
Choice b
Choice c

InvalidAccessException
InputOutputException
InvalidFileException

Choice d

IOException

You might also like