Java
Java
class Meal {
Meal() {
System.out.println("Meal()");
}
}
class Cheese {
Cheese() {
System.out.println("Cheese()");
}
}
class Lunch extends Meal {
Lunch() {
System.out.println("Lunch()");
}
}
class PortableLunch extends Lunch {
PortableLunch() {
System.out.println("PortableLunch()");
}
}
class Sandwich extends PortableLunch {
private Cheese c = new Cheese();
public Sandwich() {
System.out.println("Sandwich()"); Meal() Meal() Cheese()
} Meal() Cheese() Lunch() Sandwich()
} Lunch() Lunch() PortableLunc Meal()
public class MyClass7 { PortableLunc PortableLunc h() Lunch()
public static void main(String[] args) { h() Cheese() h() Sandwich() PortableLunc
new Sandwich(); Sandwich() Sandwich() Cheese() h()
36 Consider the following code and choose the
correct option:
class A{ int a; A(int a){a=4;}}
class B extends A{ B(){super(3);} void
displayA(){
System.out.print(a);}
public static void main(String args[]){ compiles and compilation Compiles and Compiles and
new B().displayA();}} display 0 error display 4 display 3
37
Given the following code what will be output?
public class Pass{
static int j=20;
public static void main(String argv[]){
int i=10;
Pass p = new Pass();
p.amethod(i);
System.out.println(i);
System.out.println(j);
}
Error:
public void amethod(int x){ amethod
x=x*2; parameter
j=j*2; does not
} match
} variable 20 and 40 10 and 40 10, and 20
38 The compiler
will
automatically The program
change the The compiler will compile
What will happen if a main() method of a private will find the The program successfully,
"testing" class tries to access a private variable to a error and will will compile but the .class
instance variable of an object using dot public not make a and run file will not
notation? variable .class file successfully run correctly
39 11. class Mud {
12. // insert code here
13. System.out.println("hi");
14. }
15. }
And the following five fragments:
public static void main(String...a) {
public static void main(String.* a) {
public static void main(String... a) {
public static void main(String[]... a) {
public static void main(String...[] a) {
How many of the code fragments, inserted
independently at line 12, compile? 0 1 2 3
40 class Order{
Order(){
System.out.println("Cat");
}
public static void main(String... Args){
Order obj = new Order();
System.out.println("Ant");
}
static{
System.out.println("Dog");
}
{
System.out.println("Man");
}}
consider the code above & select the proper Man Dog Cat Cat Ant Dog Dog Man Cat
output from the options. Ant Man Ant compile error
41 abstract class MineBase {
abstract void amethod();
static int i;
} Compilation
public class Mine extends MineBase { Error occurs
public static void main(String argv[]){ and to avoid
int[] ar=new int[5]; them we
for(i=0;i < ar.length;i++) A Sequence A Sequence need to
System.out.println(ar[i]); of 5 zero's of 5 one's will declare Mine
} will be printed be printed IndexOutOfB class as
} like 0 0 0 0 0 like 1 1 1 1 1 oundes Error abstract
42 public class Q {
public static void main(String argv[]) { Compiler
int anar[] = new int[] { 1, 2, 3 }; Error: anar is Compiler
System.out.println(anar[1]); referenced Error: size of
} before it is array must be
} initialized 2 1 defined
43 A constructor may return value including class
type true false
44 Consider the following code and choose the
correct option:
package aj; class S{ int roll =23;
private S(){} }
package aj; class T
{ public static void main(String ar[]){ Compilation Compiles and Compiles and Compiles but
System.out.print(new S().roll);}} error display 0 display 23 no output
45 public class c123 {
private c123() {
System.out.println("Hellow");
}
public static void main(String args[]) {
c123 o1 = new c123();
c213 o2 = new c213();
}
}
class c213 {
private c213() {
System.out.println("Hello123"); It is not
} possible to
} declare a
constructor Compilation Runs without
What is the output? Hellow as private Error any output
46 class MyClass1
{
private int area(int side)
{
return(side * side);
}
public static void main(String args[ ])
{
MyClass1 MC = new MyClass1( );
int area = MC.area(50);
System.out.println(area);
}
} Compilation Runtime
What would be the output? error Exception 2500 50
47
It is not
possible to
declare a
public class MyAr { static variable
public static void main(String argv[]) { in side of non
MyAr m = new MyAr(); static method
m.amethod(); or instance
} method.
public void amethod() { Because
static int i1; Compile time Static
System.out.println(i1); error variables are
} because i Compilation class level
} has not been and output of dependencie
What is the Output of the Program? 0 initialized null s.
48 public class MyAr {
public static void main(String argv[]) {
MyAr m = new MyAr();
m.amethod();
} Unresolved
public void amethod() { compilation
final int i1; problem: The
System.out.println(i1); local variable
} i1 may not Compilation
} have been and output of None of the
What is the Output of the Program? 0 initialized null given options
49 public class c1 {
private c1()
{
System.out.println("Hello");
}
public static void main(String args[])
{
c1 o1=new c1(); It is not Can't create
} possible to object
} declare a because
constructor Compilation constructor is
What is the output? Hello private Error private
50 Which modifier indicates that the variable
might be modified asynchronously, so that all
threads will get the correct value of the
variable. synchronized volatile transient default
51
class A {
int i, j;
A(int a, int b) {
i = a;
j = b;
}
void show() {
System.out.println("i and j: " + i + " " + j);
}
}
class B extends A {
int k;
System.out.println(set.equals(set2));
} Compile time Runtime
} What is the result of given code? true false error Exception
76 A)Property files help to decrease coupling
B) DateFormat class allows you to format
dates and times with customized styles.
C) Calendar class allows to perform date
calculation and conversion of dates and times
between timezones. A and B is A and D is A and C is B and D is
D) Vector class is not synchronized TRUE TRUE TRUE TRUE
77 Which interface does java.util.Hashtable Java.util.Tabl Java.util.Coll
implement? Java.util.Map Java.util.List e ection
78 Object get(Object key) - What does this
method return if the key is not found in the none of the
Map? 0 -1 null listed options
79 Consider the following code and choose the
correct option:
class Test{
public static void main(String args[]){
TreeSet<Integer> ts=new
TreeSet<Integer>();
ts.add(1);
ts.add(8);
ts.add(6);
ts.add(4);
SortedSet<Integer> ss=ts.subSet(2, 10);
ss.add(9);
System.out.println(ts);
System.out.println(ss); [1,4,6,8] [1,8,6,4] [1,4,6,8,9] [1,4,6,8,9]
}} [4,6,8,9] [8,6,4,9] [4,6,8,9] [4,6,8]
80 A) Iterator does not allow to insert elements
during traversal
B) Iterator allows bidirectional navigation.
C) ListIterator allows insertion of elements
during traversal
D) ListIterator does not support bidirectional A and B is A and D is A and C is B and D is
navigation TRUE TRUE TRUE TRUE
81 static void sort(List list) method is part of Collection Collections ArrayList
________ interface class Vector class class
82 static int binarySearch(List list, Object key) is ArrayList Collection Collections
a method of __________ Vector class class interface class
83 Which collection class allows you to access
its elements by associating a key with an
element's value, and provides java.util.Sorte java.util.Tree java.util.Tree java.util.Hash
synchronization? dMap Map Set table
84
Consider the following code and select the
correct output:
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class Lists {
public static void main(String[] args) {
List<String> list=new ArrayList<String>();
list.add("1");
list.add("2");
list.add(1, "3");
List<String> list2=new LinkedList<String>(list);
list.addAll(list2);
list2 =list.subList(2,5);
list2.clear();
System.out.println(list);
}
} [1,3,2] [1,3,3,2] [1,3,2,1,3,2] [3,1,2]
85 Given:
import java.util.*;
1) TreeSet
2) HashMap
3) LinkedList
4) an array 1 2 3 4
91 What will be the output of following code?
class Test{
public static void main(String args[]){
TreeSet<Integer> ts=new
TreeSet<Integer>();
ts.add(2);
ts.add(3);
ts.add(7);
ts.add(5);
SortedSet<Integer> ss=ts.subSet(1,7);
ss.add(4);
ss.add(6);
System.out.print(ss);}} [2,3,7,5] [2,3,7,5,4,6] [2,3,4,5,6,7] [2,3,4,5,6]
92
Consider the following code and choose the
correct option:
class Data{ Integer data; Data(Integer
d){data=d;}
public boolean equals(Object o){return true;}
public int hasCode(){return 1;}}
class Test{
public static void main(String ar[]){
Set<Data> s=new HashSet<Data>();
s.add(new Data(4));
s.add(new Data(2));
s.add(new Data(4));
s.add(new Data(1)); Compiles but
s.add(new Data(2)); compilation error at run
System.out.print(s.size());}} 3 5 error time
93 Consider the code below & select the correct
ouput from the options:
public class Test{
public static void main(String[] args) {
String num="";
z: for(int x=0;x<3;x++)
for(int y=0;y<2;y++){
if(x==1) break;
if(x==2 && y==1) break z;
num=num+x+y; 0 0 0 1 2 0 2 Compilation
}System.out.println(num);}} 0001 000120 1 error
94 Given:
public class Test {
public enum Dogs {collie, harrier};
public static void main(String [] args) {
Dogs myDog = Dogs.collie;
switch (myDog) {
case collie:
System.out.print("collie ");
case harrier:
System.out.print("harrier ");
}
}
} Compilation
What is the result? collie harrier fails. collie harrier
95 Consider the following code and choose the
correct output:
class Test{
public static void main(String args[]){
boolean flag=true;
if(flag=false){
System.out.print("TRUE");}else{ compilation
System.out.print("FALSE");}}} true false error Compiles
96 Cosider the following code and choose the
correct option:
class Test{
public static void main(String args[]){
System.out.println(Integer.parseInt("21474836 NumberForm
48", 10)); Compilation atException Compiles but
}} error 2.15E+09 at run time no output
97
Given:
public class Test {
public enum Dogs {collie, harrier, shepherd};
public static void main(String [] args) {
Dogs myDog = Dogs.shepherd;
switch (myDog) {
case collie:
System.out.print("collie ");
case default:
System.out.print("retriever ");
case harrier:
System.out.print("harrier ");
}
}
} Compilation
What is the result? harrier shepherd retriever fails.
98 Given:
static void myFunc()
{
int i, s = 0;
for (int j = 0; j < 7; j++) {
i = 0;
do {
i++;
s++;
} while (i < j);
}
System.out.println(s);
}
} What would be the result 20 21 22 23
99
What is the range of the random number r
generated by the code below?
int r = (int)(Math.floor(Math.random() * 8)) + 2; 2 <= r <= 9 3 <= r <= 10 2<= r <= 10 3 <= r <= 9
100 class Test{
public static void main(String[] args) {
int x=-1,y=-1;
if(++x=++y)
System.out.println("R.T. Ponting");
else
System.out.println("C.H. Gayle");
}
}
consider the code above & select the proper none of the
output from the options. R.T.Ponting C.H.Gayle Compile error listed options
101 Given:
public class Breaker2 {
static String o = "";
public static void main(String[] args) {
z:
for(int x = 2; x < 7; x++) {
if(x==3) continue;
if(x==5) break z;
o = o + x;
}
System.out.println(o);
}
}
What is the result? 2 24 234 246
102 Consider the following code and choose the
correct output:
class Test{
public static void main(String args[]){
int a=5;
if(a=3){
System.out.print("Three");}else{ Compilation Compiles but
System.out.print("Five");}}} error Three Five no output
103 Given:
public class Batman {
int squares = 81;
public static void main(String[] args) {
new Batman().go();
}
void go() {
incr(++squares);
System.out.println(squares);
}
void incr(int squares) { squares += 10; }
}
What is the result? 81 82 91 92
104 public void foo( boolean a, boolean b)
{
if( a )
{
System.out.println("A"); /* Line 5 */
}
else if(a && b) /* Line 7 */
{
System.out.println( "A && B");
}
else /* Line 11 */
{
if ( !b )
{
System.out.println( "notB") ;
}
else
{
System.out.println( "ELSE" ) ;
} If a is true If a is true If a is false If a is false
} and b is false and b is true and b is false and b is true
} then the then the then the then the
output is output is "A output is output is
What would be the result? "notB" && B" "ELSE" "ELSE"
105 What is the value of ’n’ after executing the
following code?
int n = 10;
int p = n + 5;
int q = p - 10;
int r = 2 * (p - q);
switch(n)
{
case p: n = n + 1;
case q: n = n + 2;
case r: n = n + 3;
default: n = n + 4; Compilation
} 14 28 Error 10
106 public class While
{
public void loop()
{
int x= 0;
while ( 1 ) /* Line 6 */
{
System.out.print("x plus one is " + (x +
1)); /* Line 8 */
}
} There are There are
} There is a syntax errors syntax errors There is a
syntax error on lines 1 on lines 1, 6, syntax error
Which statement is true? on line 1 and 6 and 8 on line 6
107 Which of the following loop bodies DOES
compute the product from 1 to 10 like (1 * 2 *
3*4*5*
6 * 7 * 8 * 9 * 10)?
int s = 1;
for (int i = 1; i <= 10; i++)
{
<What to put here?>
} s += i * i; s++; s = s + s * i; s *= i;
108 Character
String is a Double has a has a
Which of the following statements are true wrapper compareTo() intValue() Byte extends
regarding wrapper classes? (Choose TWO) class method method Number
109
Given:
class Atom {
Atom() { System.out.print("atom "); }
}
class Rock extends Atom {
Rock(String type) { System.out.print(type); }
}
public class Mountain extends Rock {
Mountain() {
super("granite ");
new Rock("granite ");
}
public static void main(String[] a) { new
Mountain(); }
} Compilation granite atom granite atom granite
What is the result? fails. granite granite atom granite
110 What are the thing to be placed to complete
the code?
class Wrap {
public static void main(String args[]) {
int i = iOb.intValue();
int i = 10;
Integer iOb = 100;
i = iOb;
System.out.println(i + " " + iOb);
} No,
} whether this code work properly, if so what Compilation No, Runtime Yes, 100,
would be the result? error error Yes, 10, 100 100
118 Consider the following code and choose the
correct option:
class Test{
public static void main(String args[]){
Long l=0l; Compilation
System.out.println(l.equals(0));}} error true false 1
119 int I = 0;
outer:
while (true)
{
I++;
inner:
for (int j = 0; j < 10; j++)
{
I += j;
if (j == 3)
continue inner;
break outer;
}
continue outer;
}
System.out.println(I);
int count = 1;
while ( ___________ )
{
System.out.print( count + " " );
count = count + 1;
}
System.out.println( );
import java.util.*;
class I
{
public static void main (String[] args)
{
Object i = new ArrayList().iterator();
System.out.print((i instanceof List)+",");
System.out.print((i instanceof
Iterator)+",");
System.out.print(i instanceof ListIterator);
} Prints: false, Prints: false, Prints: false, Prints: false,
} false, false false, true true, false true, true
144
Given:
public static void test(String str) {
int check = 4;
if (check = str.length()) {
System.out.print(str.charAt(check -= 1) +", ");
} else {
System.out.print(str.charAt(0) + ", ");
}
}
and the invocation:
test("four");
test("tee"); An exception
test("to"); Compilation is thrown at
What is the result? r, t, t, r, e, o, fails. runtime.
145 What will be the output of the program?
int x = 3;
int y = 1;
if (x = y) /* Line 3 */
{ The code
System.out.println("x =" + x); Compilation runs with no
} x=1 x=3 fails. output.
146
import java.util.SortedSet;
import java.util.TreeSet;
System.out.println("the prize.");
You win the You lose the
What does the code fragment prints? prize prize. You win You lose
150 Changes
made in the
Set view
returned by The Map
The return keySet() will interface
type of the be reflected extends the All keys in a
Which statements are true about maps? values() in the original Collection map are
(Choose TWO) method is set map interface unique
151 Which collection implementation is suitable for
maintaining an ordered sequence of
objects,when objects are frequently inserted in
and removed from the middle of the
sequence? TreeMap HashSet Vector LinkedList
152 OutputStrea To write
m is the characters to
abstract an
superclass of Subclasses outputstream, To write an
all classes of the class you have to object to a
that Reader are make use of file, you use
represent an used to read the class the class
outputstream character CharacterOut ObjectFileWri
Choose TWO correct options: of bytes. streams. putStream. ter
153 What is the output :
class One{
public static void main(String[] args) {
int a=100;
if(a>10)
System.out.println("M.S.Dhoni");
else if(a>20)
System.out.println("Sachin");
else if(a>30) M.S.Dhoni
System.out.println("Virat Kohli");} Sachin Virat
} M.S.Dhoni Kohli Virat Kohli all of these
154 A continue If a variable
statement of type int
doesn’t overflows
transfer during the
control to the An overflow execution of
test error can only A loop may a loop, it will
Which of the following statements is TRUE statement of occur in a have multiple cause an
regarding a Java loop? the for loop loop exit points exception
155 switch(x)
{
default:
System.out.println("Hello");
}
Which of the following are acceptable types
for x?
1.byte
2.long
3.char
4.float
5.Short
6.Long 1 ,3 and 5 2 and 4 3 and 5 4 and 6
156 When an
exception When no
occurs then a exception
part of try occurs then
block will complete try
Used to execute one block and
release the appropriate finally block
resources catch block will execute
which are Writing finally and finally but no catch
Which are true with respect to finally block? obtained in block is block will be block will
(Choose THREE) try block. optional. executed. execute.
157 What will happen when you attempt to
compile and run the following code?
public class Bground extends Thread{
public static void main(String argv[]){
Bground b = new Bground();
b.run();
} A compile A run time
public void start(){ time error error
for (int i = 0; i <10; i++){ indicating indicating Clean
System.out.println("Value of i = that no run that no run compile and
" + i); method is method is at run time Clean
} defined for defined for the values 0 compile but
} the Thread the Thread to 9 are no output at
} class class printed out runtime
158 Given:
public void testIfA() {
if (testIfB("True")) {
System.out.println("True");
} else {
System.out.println("Not true");
}
}
public Boolean testIfB(String str) {
return Boolean.valueOf(str);
} An exception
What is the result when method testIfA is is thrown at
invoked? true Not true runtime. none
159 A thread will
Both wait() resume
and notify() The wait() execution as The notify()
must be method is soon as its method is
called from a overloaded to sleep overloaded to
Which of the following statements are true? synchronized accept a duration accept a
(Choose TWO) context. duration expires. duration
160 public class MyProgram
{
public static void throwit()
{
throw new RuntimeException();
}
public static void main(String args[])
{
try
{
System.out.println("Hello world "); The program
throwit(); will print
System.out.println("Done with try block Hello world,
"); then will print The program The program
} that a will print will print
finally RuntimeExce Hello world, Hello world,
{ ption has then will print then will print
System.out.println("Finally executing occurred, that a Finally
"); then will print RuntimeExce executing,
} Done with try ption has then will print
} block, and occurred, and that a
} The program then will print then will print RuntimeExce
which answer most closely indicates the will not Finally Finally ption has
behavior of the program? compile. executing. executing. occurred.
161 If a method is capable of causing an
exception that it does not handle, it must
specify this behavior using throws so that
callers of the method can guard themselves
against such Exception false true
162
A) Checked Exception must be explicity
caught or propagated to the calling method
B) If runtime system can not find an
appropriate method to handle the exception,
then the runtime system terminates and uses Only A is Only B is Bothe A and Both A and B
the default exception handler. TRUE TRUE B is TRUE is FALSE
163 public class RTExcept
{
public static void throwit ()
{
System.out.print("throwit ");
throw new RuntimeException();
}
public static void main(String [] args)
{
try
{
System.out.print("hello ");
throwit();
}
catch (Exception re )
{
System.out.print("caught ");
}
finally
{
System.out.print("finally ");
} hello throwit
System.out.println("after "); hello throwit RuntimeExce
} caught finally hello throwit ption caught Compilation
} after caught after fails
164 class s implements Runnable
{
int x, y;
public void run()
{
for(int i = 0; i < 1000; i++)
synchronized(this)
{
x = 12;
y = 12;
}
System.out.print(x + " " + y + " ");
}
public static void main(String args[])
{
s run = new s();
Thread t1 = new Thread(run);
Thread t2 = new Thread(run);
t1.start();
t2.start(); Cannot
} Compilation determine prints 12 12
} What is the output? DeadLock Error output. 12 12
165
What is wrong with the following code?
1.Error
2.Event
3.Object
4.Throwable
5.Exception
6.RuntimeException 1, 2, 3 and 4 2, 3, 4 and 5 1, 4, 5 and 6 2, 4, 5 and 6
169 class X implements Runnable
{
public static void main(String args[])
{
/* Missing code? */
} X run = new
public void run() {} Thread t = X(); Thread t Thread t =
} Thread t = new = new new
Which of the following line of code is suitable new Thread(X); Thread(run); Thread();
to start a thread ? Thread(X); t.start(); t.start(); x.run();
170
Given:
class X { public void foo() {
System.out.print("X "); } }
try
{
int x = 0;
int y = 5 / x;
}
catch (Exception e)
{
System.out.println("Exception");
}
catch (ArithmeticException ae)
{
System.out.println(" Arithmetic Exception");
} compilation ArithmeticExc
System.out.println("finished"); finished Exception fails eption
172 Which of the following methods are static? start() join() yield() sleep()
173 static
methods can static
static be called methods do
methods are using an not have
difficult to object static direct access
maintain, reference to methods are to non-static
because you an object of always methods
can not the class in public, which are
change their which this because they defined
Which of the following statements regarding implementati method is are defined at inside the
static methods are correct? (2 answers) on. defined. class-level. same class.
174 Consider the following code and choose the
correct option:
class Test{
static void display(){
throw new RuntimeException();
} public static void main(String args[]){
try{display();
}catch(Exception e){ throw new
NullPointerException();}
finally{try{ display(); exit
}catch(NullPointerException e){ RuntimeExce
System.out.println("caught");} ption thrown Compilation
finally{ System.out.println("exit");}}}} caught exit exit at run time fails
175 class Test{
public static void main(String[] args){
try{
Integer.parseInt("1.0");
}
catch(Exception e){
System.out.println("Exception occurred");
}
catch(RuntimeException ex){
System.out.println("RuntimeException");
} Exception
}} occurred
consider the code above & select the proper Exception RuntimeExce RuntimeExce does not
output from the options. occurred ption ption compile
176 Which three of the following are methods of
the Object class?
1.notify();
2.notifyAll();
3.isInterrupted();
4.synchronized();
5.interrupt();
6.wait(long msecs);
7.sleep(long msecs);
8.yield(); 1,2,4 2,4,5 1,2,6 2,3,4
177 In the given code snippet
try { int a = Integer.parseInt("one"); }
what is used to create an appropriate catch
block? (Choose all that apply.)
A. ClassCastException
B. IllegalStateException
C. NumberFormatException ClassCastEx NumberForm IllegalStateEx IllegalArgume
D. IllegalArgumentException ception atException ception ntException
178 class Trial{
public static void main(String[] args){
try{
System.out.println("One");
int y = 2 / 0;
System.out.println("Two");
}
catch(RuntimeException ex){
System.out.println("Catch");
}
finally{
System.out.println("Finally");
} One Two One Catch One Two
}} Catch Finally One Catch Finally Catch
179 Which digit,and in what order,will be printed
when the following program is run?
Variables can
If a class has be protected
synchronized from
code, concurrent
multiple access
A static threads can problems by When a
method still access marking them thread
cannot be the with the sleeps, it
synchronized nonsynchroni synchronized releases its
Which statement is true? . zed code. keyword. locks
184 Consider the following code and choose the
correct option:
class Test{
static void display(){
throw new RuntimeException();
}
public static void main(String args[]){
try{display();
}catch(Exception e){ } Compiles but
catch(RuntimeException re){} Compiles and Compilation exception at
finally{System.out.println("exit");}}} exit no output fails runtime
185
Given:
public class ExceptionTest
{
class TestException extends Exception {}
public void runTest() throws TestException
{}
public void test() /* Line X */
{
runTest();
}
} throws
At Line X, which code is necessary to make No code is throws throw RuntimeExce
the code compile? necessary Exception Exception ption
186 Implement Implement Extend
java.lang.Run Extend java.lang.Thr java.lang.Run
nable and java.lang.Thr ead and nable and
implement ead and implement override the
Which two can be used to create a new the run() override the the start() start()
Thread? method. run() method. method. method.
187
Except in
An Error that case of VM
might be shutdown, if
thrown in a a try block
Multiple catch method must starts to
A try statements be declared execute, a
statement can catch the as thrown by correspondin
must have at same class of that method, g finally block
least one exception or be handled will always
correspondin more than within that start to
Choose the correct option: g catch block once. method. execute.
188 class PropagateException{
public static void main(String[] args){
try{
method();
System.out.println("method() called");
}
catch(ArithmeticException ex){
System.out.println("Arithmetic Exception");
}
catch(RuntimeException re){
System.out.println("Runtime Exception");
}}
static void method(){
int y = 2 / 0; Arithmetic
}} Exception
consider the code above & select the proper Arithmetic Runtime Runtime compilation
output from the options. Exception Exception Exception error
189 Given:
static void test() {
try {
String x = null;
System.out.print(x.toString() + " ");
}
finally { System.out.print("finally "); }
}
public static void main(String[] args) {
try { test(); }
catch (Exception ex) {
System.out.print("exception "); }
} Compilation finally
What is the result? null fails. exception finally
190 Given two programs:
1. package pkgA;
2. public class Abc {
3. int a = 5;
4. protected int b = 6;
5. public int c = 7;
6. }
3. package pkgB;
4. import pkgA.*;
5. public class Def {
6. public static void main(String[] args) {
7. Abc f = new Abc();
8. System.out.print(" " + f.a);
9. System.out.print(" " + f.b);
10. System.out.print(" " + f.c);
11. } Compilation Compilation Compilation
12. } fails with an fails with an fails with an
What is the result when the second program error on line 5 followed by error on line error on line
is run? (Choose all that apply) 9 an exception 7 8
191
System.out.print("Start ");
try
{
System.out.print("Hello world");
throw new FileNotFoundException();
}
System.out.print(" Catch Here "); /* Line 7 */
catch(EOFException e)
{
System.out.print("End of file exception");
}
catch(FileNotFoundException e)
{
System.out.print("File not found");
}
Code output:
given that EOFException and Code output: Start Hello
Code output:
FileNotFoundException are both subclasses Start Hello world Catch
Start Hello
of IOException. If this block of code is pasted The code will world File Not Here File not
world End of
in a method, choose the best option. not compile. Found found.
file exception.
192 Any
Any statement
catch(X x) statement that can
can catch that can throw an
subclasses of The Error throw an Exception
X where X is class is a Error must be must be
a subclass of RuntimeExce enclosed in a enclosed in a
Which of the following statements is true? Exception. ption. try block. try block.
193 Consider the following code and choose the
correct option:
int array[] = new int[10]; compiles does not none of the
array[-1] = 0; successfully compile runtime error listed options
194 What will be the output of the program?
class SuperClass
{
public Integer getLength()
{
return new Integer(4);
}
}
class Money {
private String country = "Canada";
public String getC() { return country; } }
class Yen extends Money {
public String getC() { return super.country; } Compiles but
public static void main(String[] args) { Compilation error at run
System.out.print(new Yen().getC() ); } } Canada error time null
236 we must use we must use
always always
extends and implements
later we must and later we we can use in extends and
When we use both implements & extends use must use any order its implements
keywords in a single java program then what implements extends not at all a can't be used
is the order of keywords to follow? keyword. keyword. problem together
237 Consider the code below & select the correct
ouput from the options:
1. public class Mountain {
2. protected int height(int x) { return 0; }
3. }
4. class Alps extends Mountain {
5. // insert code here
6. }
Which five methods, inserted independently at
line 5, will compile? (Choose three.)
A. public int height(int x) { return 0; }
B. private int height(int x) { return 0; }
C. private int height(long x) { return 0; }
D. protected long height(long x) { return 0; }
E. protected long height(int x) { return 0; } A,B,E A,C,D B,D,E C,D,E
238 Given:
interface DeclareStuff {
public static final int Easy = 3;
void doStuff(int t); }
public class TestDeclare implements
DeclareStuff {
public static void main(String [] args) {
int x = 5;
new TestDeclare().doStuff(++x);
}
void doStuff(int s) {
s += Easy + ++s;
System.out.println("s " + s);
} Compilation
} What is the result? s 14 s 16 s 10 fails.
239 Given:
interface A { public void methodA(); }
interface B { public void methodB(); }
interface C extends A,B{ public void
methodC(); } //Line 3 If you define If you define
class D implements B { D e = (D) D e = (D)
public void methodB() { } //Line 5 (new E()), (new E()),
} then then
class E extends D implements C { //Line 7 e.methodB() e.methodB()
public void methodA() { } invokes the invokes the
public void methodB() { } //Line 9 Compilation version of Compilation version of
public void methodC() { } fails, due to methodB() fails, due to methodB()
} an error in defined at an error in defined at
What would be the result? line 3 line 9 line 7 line 5
240 It must be It must be
used in the used in the
It can only be last first
used in the Only one statement of statement of
Which of the following statements is true parent's child class the the
regarding the super() method? constructor can use it constructor. constructor.
241
Consider the following code and choose the
correct option:
interface Output{
void display();
void show();
}
class Screen implements Output{
void show() {System.out.println("show");}
void display(){ System.out.println("display"); Compiles but
}public static void main(String[] args) { Compilation error at run Runs but no
new Screen().display();}} display error time output
242 Consider the following code and choose the
correct option:
class A{
void display(){ System.out.println("Hello A");
}}
class B extends A{
void display(){
System.out.println("Hello B"); }}
public class Test {
public static void main(String[] args) { Compiles but
B b=(B) new A(); Compilation error at
b.display(); }} Hello A error Hello B runtime
243 Consider the following code:
// Class declarations: Definitely
class Super {} legal at Definitely
class Sub extends Super {} runtime, but legal at
// Reference declarations: Legal at the cast runtime, and
Super x; compile time, operator the cast
Sub y; but might be (Sub) is not operator
Which of the following statements is correct Illegal at illegal at strictly (Sub) is
for the code: y = (Sub) x? compile time runtime needed. needed.
244 Given:
11. class ClassA {}
12. class ClassB extends ClassA {}
13. class ClassC extends ClassA {}
and:
21. ClassA p0 = new ClassA();
22. ClassB p1 = new ClassB();
23. ClassC p2 = new ClassC();
24. ClassA p3 = new ClassB();
25. ClassA p4 = new ClassC(); p1 =
Which TWO are valid? (Choose two.) p0 = p1; p2 = p4; (ClassB)p3; p1 = p2;
245 Consider the following code and choose the
correct option:
abstract class Car{
abstract void accelerate();
}
class Lamborghini extends Car{
@Override
void accelerate() {
System.out.println("90 mph"); }
void nitroBooster(){
System.out.print("150 mph"); }
public static void main(String[] args) {
Car mycar=new Lamborghini(); Compiles but
Lamborghini lambo=(Lamborghini) mycar; Compilation error at
lambo.nitroBooster();}} 150 mph error 90 mph runtime
246 Consider the following code and choose the
correct option:
class A{
void display(){ System.out.println("Hello A");
}}
class B extends A{
void display(){
System.out.println("Hello B"); }}
public class Test {
public static void main(String[] args) {
A a=new B(); Compiles but
B b= (B)a; Compilation error at
b.display(); }} Hello A error Hello B runtime
247 Because of
Because of single Because of Because of
single inheritance, single single
inheritance, Mammal can inheritance, inheritance,
Mammal can have no other Animal can Mammal can
A class Animal has a subclass Mammal. have no parent than have only have no
Which of the following is true: subclasses Animal one subclass siblings.
248
class Animal {
void makeNoise() {System.out.println("generic
noise"); }
}
class Dog extends Animal {
void makeNoise() {System.out.println("bark"); }
void playDead() { System.out.println("roll
over"); }
}
class CastTest2 {
public static void main(String [] args) {
Animal a = new Dog();
a.makeNoise();
}
}
consider the code above & select the proper
output from the options. run time error generic noise bark compile error
249 What will be the result when you try to
compile and run the following code?
class Base1 {
Base1() {
int i = 100;
System.out.println(i);
}
}
Given:
class Pizza {
java.util.ArrayList toppings;
public final void addTopping(String topping) {
toppings.add(topping);
}
}
public class PepperoniPizza extends Pizza {
public void addTopping(String topping) {
System.out.println("Cannot add Toppings");
}
public static void main(String[] args) {
Pizza pizza = new PepperoniPizza();
pizza.addTopping("Mushrooms"); A
} The code NullPointerEx
} Compilation Cannot add runs with no ception is
What is the result? fails. Toppings output. thrown
255 Consider the following code and choose the
correct option:
interface console{
int line=10;
void print();}
class a implements console{
void print(){
System.out.print("A");} Compiles but
public static void main(String ar[]){ Compilation error at run Runs but no
new a().print();}} A error time output
256 private final public static
Which of these field declarations are legal in public int final static int static int int answer =
an interface? (Choose all applicable) answer = 42; answer = 42; answer = 42; 42;
257 Given :
No—there No—but a Yes—an
Day d; must always object of object can be
BirthDay bd = new BirthDay("Raj", 25); be an exact parent type assigned to a Yes—any
d = bd; // Line X match can be reference object can be
between the assigned to a variable of assigned to
Where Birthday is a subclass of Day. State variable and variable of the parent any reference
whether the code given at Line X is correct: the object child type. type. variable.
258
If both a If neither
subclass and super() nor
its superclass this() is
do not have declared as
A super() or any declared the first If super() is
this() call constructors, statement in the first
must always the implicit the body of a statement in
be provided default constructor, the body of a
explicitly as constructor of this() will constructor,
the first the subclass implicitly be this() can be
statement in will call inserted as declared as
the body of a super() when the first the second
Select the correct statement: constructor. run statement. statement
259
public final static final final data
data type data type type
Choose the correct declaration of variable in varaibale=inti static data varaiblename variablename
an interface: alization; type variable; ; =intialization;
260 Consider the following code and choose the
correct option:
abstract class Fun{
void time(){
System.out.println("Fun Time"); }}
class Run extends Fun{
void time(){
System.out.println("Fun Run"); }
public static void main(String[] args) { Compiles but
Fun f1=new Run(); Compilation error at
f1.time(); }} Fun Time error Fun Run runtime
261
interface Vehicle{
void drive();
}
final class TwoWheeler implements Vehicle{
int wheels = 2;
public void drive(){
System.out.println("Bicycle");
}
}
class ThreeWheeler extends TwoWheeler{
public void drive(){
System.out.println("Auto");
}}
class Test{
public static void main(String[] args){
ThreeWheeler obj = new ThreeWheeler();
obj.drive();
}}
consider the code above & select the proper
output from the options. Auto Bicycle Auto compile error runtime error
262
Consider the following code and choose the
correct option:
interface employee{
void saldetails();
void perdetails();
}
abstract class perEmp implements employee{
public void perdetails(){
System.out.println("per details"); }}
class Programmer extends perEmp{
public static void main(String[] args) {
perEmp emp=new Programmer(); sal details compilation per details
emp.saldetails(); }} sal details per details error sal details
263 All data members in an interface are by abstract and public and public ,static default and
default final abstract and final abstract
264 Consider the following code and choose the
correct option:
interface console{
int line;
void print();}
class a implements console{
public void print(){
System.out.print("A");} Compiles but
public static void main(String ar[]){ Compilation error at run Runs but no
new a().print();}} A error time output
265
An abstract
class is one
An abstract which
class is one contains An abstract
which some defined class is one
contains methods and which
general some contains only Abstract
Which of the following is correct for an purpose undefined static class can be
abstract class. (Choose TWO) methods methods methods declared final
266
abstract class
Vehicle {
abstract class abstract class abstract abstract void
Vehicle { Vehicle { Vehicle { display(); {
Which of the following defines a legal abstract abstract void abstract void abstract void System.out.pr
class? display(); } display(); } display(); } intln("Car"); }}
267 Consider the code below & select the correct
ouput from the options:
class Mountain{
int height;
protected Mountain(int x) { height=x; }
public int getH(){return height;}}
class SomeException {
}
class A {
public void doSomething() { }
} Compilation Compilation
of class A will of class B will
class B extends A { Compilation Compilation fail. fail.
public void doSomething() throws of both of both Compilation Compilation
SomeException { } classes A & classes will of class B will of class A will
} B will fail succeed succeed succeed
269 No—if a
class
implements
several Yes— either
interfaces, of the two
each variables can Yes—since
constant No—a class be accessed the
must be may not through : definitions
Is it possible if a class definition implements defined in implement interfaceNam are the same
two interfaces, each of which has the same only one more than e.variableNa it will not
definition for the constant? interface one interface me matter
270
The
An overriding parameter list
method can of an
declare that it overriding
throws method can
checked be a subset
Private A subclass exceptions of the
methods can override that are not parameter list
cannot be any method thrown by the of the method
overridden in in a method it is that it is
Select the correct statement: subclasses superclass overriding overriding
271 Consider the following code and choose the
correct option:
class A{
void display(){ System.out.println("Hello A");
}}
class B extends A{
void display(){
System.out.println("Hello B"); }}
public class Test {
public static void main(String[] args) {
A a=new B(); Compiles but
B b= a; Compilation error at
b.display(); }} Hello A error Hello B runtime
272 Helps the
compiler to
find the
source file
that
corresponds
to a class, Helps
when it does Javadoc to
not find a Helps JVM to build the
Which of the following option gives one To maintain class file find and Java
possible use of the statement 'the name of the the uniform while execute the Documentati
public class should match with its file name'? standard compiling classes on easily
273
Holds the Holds the
location of Holds the location of
Core Java location of User Defined Holds the
Class Library Java classes, location of
Which of the following statement gives the (Bootstrap Extension packages Java
use of CLASSPATH? classes) Library and JARs Software
274
Sub
Packages Packages packages
can contain can contain should be
both Classes non-java declared as
Packages and elements private in
can contain Interfaces such as order to deny
Which of the following are true about only Java (Compiled images, xml importing
packages? (Choose 2) Source files Classes) files etc. them
275 Which of the following options give the valid
argument types for main() method? (Choose
2) String [][]args String args[] String[] args[] String[] args
276
[email protected]
Which of the following options give the valid dollorpack.$p _score.pack. [email protected]
package names? (Choose 3) ack.$$pack $$.$$.$$ __pack erp@ckage
277 Object class
provides the
Object class method for
has the core Set
Object class methods for implementati
Object class cannot be thread on in
Which of the following statements are true is an abstract instantiated synchronizati Collection
regarding java.lang.Object class? (Choose 2) class directly on framework
278 Java
Java Java Runtime Database
The term 'Java Platform' refers to Compiler Environment Connectivity Java
________________. (Javac) (JRE) (JDBC) Debugger
279 registerDriver
() method
and
Which of the following methods are needed registerDriver Class.forNam Class.forNam getConnectio
for loading a database driver in JDBC? () method e() e() n
280
Using the
static method
registerDriver
() method
Using which is Either
forName() available in forName() or
which is a DriverManag registerDriver None of the
how to register driver class in the memory? static method er Class. () given options
281 Give Code snipet:
{// Somecode
ResultSet rs = st.executeQuery("SELECT *
FROM survey");
while (rs.next()) {
String name = rs.getString("name");
System.out.println(name);
}
rs.close();
// somecode
} What should be imported related to java.sql.Resu java.sql.Drive java.sql.Drive java.sql.Conn
ResultSet? ltSet r rManager ection
282
Consider the following code & select the
correct option for output.
String sql ="select empno,ename from emp";
PreparedStatement
pst=cn.prepareStatement(sql);
System.out.println(pst.toString());
ResultSet rs=pst.executeQuery(); will show first Compiles but
System.out.println(rs.getString(1)+ " employee Compilation error at run Compiles but
"+rs.getString(2)); record error time no output
283
Which of the following methods finds the Connection.g ResultSetMet DatabaseMet Database.get
maximum number of connections that a etMaxConne aData.getMa aData.getMa MaxConnecti
specific driver can obtain? ctions xConnections xConnections ons
284 By default all JDBC transactions are
autocommit. State TRUE/FALSE. true false
285 DriverManag Driver ResultSet Statement
getConnection() is method available in? er Class Interface Interface Interface
286 A) By default, all JDBC transactions are auto
commit
B) PreparedStatement suitable for dynamic
sql and requires one time compilation
C) with JDBC it is possible to fetch information Only A and B Only B and C Both A and C
about the database is TRUE is True is TRUE All are TRUE
287 It returns int
value as
mentioned
below: > 0 if
many
columns
Contain Null
Value < 0 if
It returns true no column
when last contains Null
There is no read column Value = 0 if
such method contain SQL one column
What is the use of wasNull() in ResultSet in ResultSet NULL else contains Null none of the
interface? interface returns false value listed options
288 Given :
public class MoreEndings {
public static void main(String[] args) throws
Exception {
Class driverClass =
Class.forName("sun.jdbc.odbc.JdbcOdbcDrive
r");
DriverManager.registerDriver((Driver)
driverClass.newInstance()); java.sql.Drive
// Some code r
} Inorder to compile & execute this code, what java.sql.Drive java.sql.Drive java.sql.Drive java.sql.Data
should we import? r r rManager Source
289
Which of the following method can be used to
execute to execute all type of queries i.e. executeAllSQ executeQuer
either Selection or Updation SQL Queries? executeAll() L() execute() y()
290
Which method will return boolean when we try executeUpda executeSQL( executeQuer
to execute SQL Query from a JDBC program? te() ) execute() y()
291
Cosider the following code & select the
correct output.
String sql ="select rollno, name from student";
PreparedStatement
pst=cn.prepareStatement(sql);
System.out.println(pst.toString());
ResultSet rs=pst.executeQuery(); Compiles but
while(rs.next()){ will show only Compilation error at run
System.out.println(rs.getString(3)); } name error will show city time
292
It is possible to insert/update record in a table
by using ResultSet. State TRUE/FALSE true false
293 Read only, Updatable,
What is the default type of ResultSet in JDBC Read Only, Updatable, Scroll Scroll
applications? Forward Only Forward only Sensitive sensitive
294 An application can connect to different
Databases at the same time. State
TRUE/FALSE. true false
295 A) It is not possible to execute select query
with execute() method
B) CallableStatement can executes store Both A and B Only A is Only B is Both A and B
procedures only but not functions is FALSE TRUE TRUE is TRUE
296 A) When one use callablestatement, in that
case only parameters are send over network
not sql query.
B) In preparestatement sql query will compile Both A and B Both A and B Only A is Only B is
for first time only is FALSE is TRUE TRUE TRUE
297 Consider the code below & select the correct
ouput from the options:
Rodent rod;
Rat rat = new Rat();
Mouse mos = new Mouse();
PocketMouse pkt = new PocketMouse();
class Accounts
{
public double calculateBonus(){//method's
code} Simple
} Aggregation Association Dependency Composition
339
Given classes A, B, and C, where B extends
A, and C extends B, and where all classes
implement the instance method void doIt().
How can the doIt() method in A be It is not his.super.doIt ((A)
called from an instance method in C? possible super.doIt() () this).doIt();
340 int [] a =
Which of the following will declare an array Array a = {23,22,21,20, int a [] = new
and initialize it with five numbers? new Array(5); 19}; int[5]; int [5] array;
341 Which of the following are correct variable
names? (Choose TWO) int #ss; int 1ah; int _; int $abc;
342 What is the output of the following:
int a = 0;
int b = 10;
a = --b ;
System.out.println("a: " + a + " b: " + b ); a: 9 b:11 a: 10 b: 9 a: 9 b:9 a: 0 b:9
343 As per the following code fragment, what is
the value of a?
String s;
int a;
s = "Foolish boy.";
a = s.indexOf("fool"); -1 0 4 random value
344 Consider the following code snippet:
int i = 10;
int n = i++%5;
What are the values of i and n after the code
is executed? 10, 1 11, 1 10,0 11,0
345 Consider the following code and choose the
correct output:
int value = 0;
int count = 1;
value = count++ ;
System.out.println("value: "+ value + " count: value: 0 value: 0 value: 1 value: 1
" + count); count: 0 count: 1 count: 1 count: 2
346 Consider the following code and select the
correct output:
class Test{
interface Y{
void display(); }
public static void main(String[] args) {
new Y(){
public void display(){ Compiles but Compiles but
System.out.println("Hello World"); } }; Compilation error at run run without
}} Hello World error time output
347
What is the output of the following program?
public class demo {
public static void main(String[] args) {
int arr[5];
for (int i = 0; i < arr.length; i++) {
arr[i] = arr[i] + 10;
}
for (int j = 0; j < arr.length; j++)
System.out.println(arr[j]); A sequence
A sequence of Garbage
} of five 10's Values are compile time Compiles but
} are printed printed Error no output
348 Which of the following methods registers a
thread in a thread scheduler? run(); construct(); start(); register();
349 class PingPong2 {
synchronized void hit(long n) {
for(int i = 1; i < 3; i++)
System.out.print(n + "-" + i + " ");
}
}
public class Tester implements Runnable {
static PingPong2 pp2 = new PingPong2();
public static void main(String[] args) {
new Thread(new Tester()).start();
new Thread(new Tester()).start();
}
public void run() {
pp2.hit(Thread.currentThread().getId()); } The output The output The output The output
} could be 5-1 could be 6-1 could be 6-1 could be 6-1
Which statement is true? 6-1 6-2 5-2 6-2 5-1 5-2 5-2 6-2 5-1 6-2 5-1 7-1
350 Consider the following code and choose the
correct option:
class Cthread extends Thread{
public void run(){
System.out.print("Hi");}
public static void main (String args[]){
Cthread th1=new Cthread(); will print Hi
th1.run(); twice and
th1.start(); throws
th1.run(); Exception at will print Hi Compilation will print Hi
}} run time Thrice error once
351 class Cthread extends Thread{
public void run(){
System.out.print("Hi");}
public static void main (String args[]){
Cthread th1=new Cthread(); will print Hi
th1.run(); twice and
th1.start(); throws
th1.start(); will start two will print Hi exception at
}} thread Once will not print runtime
352 Consider the following code and choose the
correct option:
class Cthread extends Thread{
Cthread(){start();}
public void run(){
System.out.print("Hi");} will create
public static void main (String args[]){ two child
Cthread th1=new Cthread(); threads and will not create
Cthread th2=new Cthread(); display Hi compilation any child will display Hi
}} twice error thread once
353 Which of the following methods are defined in
class Thread? (Choose TWO) start() wait() notify() run()
354 The following block of code creates a Thread
using a Runnable target:
EqTest(){
String s="Java";
String s2="java";
// Line X
{
System.out.println("Equal");
}else
{
System.out.println("Not equal");
}
} if(s.equals(s2 if(s.equalsIgn if(s.noCaseM
} if(s==s2) )) oreCase(s2)) atch(s2))
394 import java.io.*;
public class MyClass implements Serializable
{
private int a;
public int getA() { return a; }
publicMyClass(int a){this.a=a; }
private void writeObject( ObjectOutputStream
s)
throws IOException {
// insert code here
}
}
Given :
import java.io.*;
public class ReadingFor {
public static void main(String[] args) {
String s;
try {
FileReader fr = new FileReader("myfile.txt");
BufferedReader br = new BufferedReader(fr);
while((s = br.readLine()) != null)
System.out.println(s);
br.flush();
} catch (IOException e) {
System.out.println("io error"); }
}
}
And given that myfile.txt contains the following
two lines of data:
ab
cd Compilation
What is the result? ab Error ab cd abcd
403 Consider the following code and choose the
correct option:
class std{
int call; std(int c){call=c;}
int getCall(){return call;}
}
public class Test{
public static void main(String[] args) throws
IOException {
File file=new File("d:/std.txt");
FileOutputStream fos=new
FileOutputStream(file);
ObjectOutputStream oos=new
ObjectOutputStream(fos); the state of
std s1=new std(10); the state of the object s1
oos.writeObject(s1); the object s1 Compiles but will not be
oos.close(); will be store Compilation error at run store to the
}} to file std.txt error time file.
404 Consider the following code and choose the
correct option:
public class Test {
public static void main(String[] args) {
File file=new File("D:/jlist.lst");
byte buffer[]=new byte[(int)file.length()+1]; reads data
FileInputStream fis=new reads data from file
FileInputStream(file); from file named jlist.lst
fis.read(buffer); named jlist.lst in byte form
System.out.println(buffer); in byte form and display Compiles but
} and display it Compilation garbage error at
} on console. error value runtime
405 Consider the following code and choose the
correct option:
public class Test {
public static void main(String[] args) throws
IOException { reads data
File file=new File("D:/jlist.lst"); reads data from file
byte buffer[]=new byte[(int)file.length()+1]; from file named jlist.lst
FileInputStream fis=new named jlist.lst in byte form
FileInputStream(file); in byte form and display Compiles but
fis.read(buffer); and display it Compilation
garbage error at
System.out.println(new String(buffer)); }} on console. error value runtime
406 throws a
What happens when the constructor for throws a throws a ArrayIndexOu
FileInputStream fails to open a file for DataFormatE FileNotFound tOfBoundsEx
reading? xception Exception ception returns null
407 Consider the following code and choose the
correct option: creates Compiles and
public class Test { directories executes but
public static void main(String[] args) { names prj Compiles but directories
File file=new File("d:/prj,d:/lib"); and lib in d: Compilation error at run are not
file.mkdirs();}} drive error time created
408 Consider the following code and choose the
correct output:
public class Person{
public void talk(){ System.out.print("I am a
Person "); }
}
public class Student extends Person {
public void talk(){ System.out.print("I am a
Student "); }
}
what is the result of this piece of code:
public class Test{
public static void main(String args[]){
Person p = new Student();
p.talk(); I am a I am a
} I am a I am a Person I am Student I am
} Person Student a Student a Person
409 Which of these are two legal ways of
accessing a File named "file.tst" for reading.
Select the correct option:
A)FileReader fr = new FileReader("file.tst");
B)FileInputStream fr = new
FileInputStream("file.tst");
C)InputStreamReader isr = new
InputStreamReader(fr, "UTF8");
D)FileReader fr = new FileReader("file.tst",
"UTF8"); A,D B,C C,D A,B
410 What is the DataOutputStream method that
writes double precision floating point values to
a stream? writeBytes() writeFloat() write() writeDouble()
411 Consider the following code and choose the
correct option:
public class Test{
public static void main(String[] args) {
File dir = new File("dir"); The file
dir.mkdir(); The file The file system has a
File f1 = new File(dir, "f1.txt"); try { The file system has a system has a directory
f1.createNewFile(); } catch (IOException e) { system has a new empty directory named
;} new empty directory named dir, newDir,
File newDir = new File("newDir"); directory named containing a containing a
dir.renameTo(newDir);} } named dir newDir file f1.txt file f1.txt
412
Consider the following code and choose the
correct option:
public class Test {
public static void main(String[] args) throws
IOException {
File file=new File("d:/data");
byte buffer[]=new byte[(int)file.length()+1];
FileInputStream fis=new Compiles and
FileInputStream(file); Transfer runs but
fis.read(buffer); content of file Compiles but content not
FileWriter fw=new FileWriter("d:/temp.txt"); data to the Compilation error at transferred to
fw.write(new String(buffer));}} temp.txt error runtime the temp.txt
413
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
public class MoreEndings {
public static void main(String[] args) {
try {
FileInputStream fis = new
FileInputStream("seq.txt");
InputStreamReader isr = new
InputStreamReader(fis);
int i = isr.read();
while (i != -1) {
System.out.print((char)i + "|");
i = isr.read();
}
} catch (FileNotFoundException fnf) {
System.out.println("File not found");
} catch (EOFException eofe) {
System.out.println("End of stream");
} catch (IOException ioe) {
System.out.println("Input error");
} The program
} will not
} compile The program
Assume that the file "seq.txt" exists in the because a The program The program will compile,
current directory, has the required certain will compile will compile print H|e|l|l|o|,
access permissions, and contains the string unchecked and print and print and then
"Hello". exception is H|e|l|l|o|Input H|e|l|l|o|End terminate
Which statement about the program is true? not caught. error. of stream. normally.
414 Consider the following code and choose the
correct option:
public class Test{ Skip the first
public static void main(String[] args) throws seven
IOException { characters
File file = new File("d:/temp.txt"); and then
FileReader reader=new FileReader(file); starts reading
reader.skip(7); int ch; file and Compiles and Compiles but
while((ch=reader.read())!=-1){ display it on Compilation runs without error at
System.out.print((char)ch); } }} console error output runtime
415 The file is
modified from
A file is readable but not writable on the file A being
system of the host platform. What will SecurityExce The boolean The boolean unwritable to
be the result of calling the method canWrite() ption is value false is value true is being
on a File object representing this file? thrown returned returned writable.
416 void add(int void add(int void add(int
x,int y) char char add(float x,int y) char x,int y) void
Which of following set of functions are add(int x,int x) char add(char sum(double
example of method overloading y) add(float y) x,char y) x,double y)
417
Efficient avoiding
utilization of Code method name
What is the advantage of runtime memory at flexibility at confusion at
polymorphism? runtime Code reuse runtime runtime
418
Which of the following is an example of IS A Microprocess
relationship? Ford - Car or - Computer Tea -Cup Driver -Car
419 Which of the following is not a valid relation Segmentatio
between classes? Inheritance n Instantiation Composition
420 Which of the following is not an attribute of
object? State Behaviour Inheritance Identity
QuestionText Choice1 Choice2 Choice3 Choice4 Choice5 Grade1 Grade2 Grade3 Grade4 Grade5 AnswerDescription
QuestionMedia AnswerMedia Author Reviewer Is Numeric
int main()
{
for( i = 0; i < 10; increment( i ) )
{
}
printf("i=%d\n", i);
return 0;
}
What is the output of given code snippet? loop will go infinite state. i=10 i=9 i=11 1 0 0 0 TEXT TEXT
void main()
{
int d,i,j;
d=0;
for(i=1; i<5 ; i++)
for(j=1; j<5 ; j++)
if(((i+j)%3) == 0)
d= d+1;
printf("%d" , d);
getch();
} 10 13 5 20 0 0 1 0 TEXT TEXT
void main( )
{
int i = 1, j = 1 ;
for ( ; ; )
{
if ( i > 5 )
break ;
else
j += i ;
printf ( "%d ", j ) ;
i += j ;
} Compile
} Run time error 25 24 Time Error 0 1 0 0 TEXT TEXT
void main()
{
FILE *fp;
clrscr();
fp=fopen("XYZ.doc","w");
fputs("Hello",fp); XYZ file will
fclose(fp); Compile-time XYZ file will contain
} None of these. error be black "Hello" 0 0 0 1 TEXT TEXT
Carefully read the question & answer accordingly: The
Content of a file will be lost if it is opened in : w+ mode w mode a mode c mode 1 0 0 0 TEXT TEXT
A serial
search
continues
searching
element by A serial
element search is
either until a useful when
A serial match is the amount of
For a serial search to work search found or until data that
the data in the array must begins with the end of must be
Carefully read the question and answer accordingly. not be alphabetic or the first Array array is searched is
Which of the options is false : numeric order. element found. large. 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly. Push-down None of the
Which of the following name does not relate to stacks? LIFO list lists options. FIFO lists 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
The operation of processing each element in the list is
known as Sorting Inserting Merging Traversal 0 0 0 1 TEXT TEXT
Identify the Specify the
base of Direct the problem
Carefully read the question & answer accordingly: number output to a completely
Algorithm and Flow chart help us to Know the memory capacity system printer and clearly 0 0 0 1 TEXT TEXT
void fun();
int i = 10;
void main()
{
int i =20;
printf("%d",i);
i = 30;
fun();
}
void fun()
{
printf("%d",i);
} 20 30 10 30 20 20 20 10 0 0 0 1 TEXT TEXT
No need to
worry about
Does not the allocation
store in Automatic and de-
Carefully read the question & answer accordingly: contiguous array bounds allocation of
Which is true about array ? None of the given options locations checking arrays 1 0 0 0 TEXT TEXT
Carefully read the question & answer accordingly:
Which of the following function is more appropriate for
reading in a multi-word string? printf(); puts(); scanf(); gets(); 0 0 0 1 TEXT TEXT
void main() {
int arr[][3]={{1,2},{3,4,5},{5,4}};
printf("%d %d %d",arr[0][2],arr[1][2],arr[2][1]);
getch();
}
What is the output of the given code snippet? Compilation error Runtime error 0,5,5 0,5,4 2,4, 5 0 0 0 1 0 TEXT TEXT
Address of
Carefully read the question & answer accordingly: If the last
you pass an array as an argument to a function, what Base address First element element of
actually gets passed? Value of elements in array of the array of the array array 0 1 0 0 TEXT TEXT
int main()
{
char str[] = "Programming";
printf("%s ",&str[2]);
printf("%s ",str);
printf("%s ",&str); Program
Compiled ogramming Programming
return(0); ogramming Programming < with Syntax Programming ogramming
} Garbage Value > Errors Programming Programming 0 0 1 0 TEXT TEXT
Better
Sharing of It is Easy to
critical updated and
database modernise
resources Faster system, both
and other Response hardware and
application and flexibility software as
softwares to changing the Reduce
among environment companies operation and
Carefully read the question and answer accordingly. clients of business evolved and maintenance
What are the benefits of employing Client-Server throughout world has new cost to a
Computing in business ? All the listed options the network. outside. requirements. large extent. 1 0 0 0 0 TEXT TEXT
Accepts
connections
Waits for Interacts with from large
Carefully read the question and answer accordingly. Processes and serves client end user with All the listed number of
Which of these are the functionalities of a Server client requests requests GUI options clients 0.33 0.33 0 0 0.33 TEXT TEXT
uses more
than three uses three
sets of sets of
computers in computers in
which the which the
client is clients are
responsible responsible
forpresentatio for
n, one set of presentimentl
servers is ogic, one set
responsible of servers are
for data responsible
access logic for
and data application
storage,and logic, and
uses only two sets of application one set of
computers in which the logic is serversare
clients are responsible for puts less load spread responsible
theapplication and on a network across two or for the data
Carefully read the question and answer accordingly. presentation logic, and the than a two- more access logic
An N-tiered architecture _____. choose all answers servers are responsible for tiered different sets and data
applicable the data architecture of servers storage 0 0.5 0.5 0 TEXT TEXT
Carefully read the question and answer accordingly. Business
The database server holds the following ________ and Database Management Database All the given logic of data
______. systems instances options access 0.5 0.5 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
The computer that accepts, prioritizes, and processes printer file
print jobs is known as the print server print client mainframe server. 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. In
3-tier computing, the request/response protocol POP3 NNTP SMTP
between the clients and web servers is HTTP MOM 1 0 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
One major disadvantage of an n-tiered client-server
architecture is that it is much more Difficult to program
and test software false true 0 1 TEXT TEXT
Carefully read the question and answer accordingly. A
company ___________________ can be used to None of the
provide shared content for staff only intranet listed options extranet opranet Internet 1 0 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. In
the client/server architecture, the component that
processes the request and sends the response Network Server
is_______________ Client O.S. Protocol 0 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly. An
advantage of the three-tier architecture over the two- Better Easier All the listed
tier architecture is: Better control over the data performance maintenance options 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Choose the correct option from the list POWER(5*6) POWER(5,6) POWER(5#6) POWER(5^6) 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Which excel function is used to calculate the Rates of All of the
Return? Statistical Mathematical listed options Financial Logical 0 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly. All the listed Group of Group of
Workspace denotes _____________. Group of worksheets options rows workbooks 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly. All the listed
Choose an example of a function from the given list C1+C5 ADD(C1:C5) options AVG(C1:C5) C1:C5 0 0 0 1 0 TEXT TEXT
The data in
the table
should be The data in
sorted in the table
ascending need not be
VLOOKUP order, while sorted, while
Carefully read the question and answer accordingly. VLOOKUP function can be stands for using using
Choose the correct statements related to VLOOKUP used on a series of data in Vertical VLOOKUP VLOOKUP
function single column LOOKUP function function 0 0.5 0.5 0 TEXT TEXT
Option 1 ---
Option 2 --- Option 3 --- Text, Values
Carefully read the question and answer accordingly. Both Options Text, Values Text, Values and
Choose the types of data used in Excel. Both Options 1 and 2 1 and 3 and Formulas and Charts Functions 1 0 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Excel stores dates and times as numbers, which
enables its usage as functions and formulas. State
True or False. false true 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
Which is the key used to select multiple non-adjacent None of the CTRL+Shift
cells in a worksheet, while clicking on them Shift Key CTRL Key ALT key listed options Key 0 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. Option 1 --- Option 3 --- Option 2 ---
Choose the correct syntax of the AVERAGE function in All the listed AVERAGE AVERAGE AVERAGE
excel Both Options 2 and 3 options (G1,H1) (G1:G9,H1: (G1:H9) 0 1 0 0 0 TEXT TEXT
H9)
A column is
not wide
Carefully read the question and answer accordingly. A Function enough to A value of the
What does the Error Value #NAME? specify in an name is display the name is
excel? All the listed options misspelled name misspelled 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Choose the option to fit long addresses of multiple lines Text Wrap All the listed Shrink to Fit
in a single cell? Merge option option options option 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly. Value_when_ None of the Value_if_fals
Which of these is not an argument of the IF function? Logical_test false listed options Value_if_true e 0 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. only options option 1 --- option 2 --- option 3 ---
What are the types of charts, excel can produce? All the listed options 1 and 3 Bar charts Line graphs Pie charts 1 0 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. Two columns Two columns Two columns
What is the resultant of the below action? will be will be will be
Select both the columns M and N in a worksheet and Two columns will be inserted after inserted after inserted after
choose -> Insert -> Insert Sheet Columns inserted after column L column M column O column N 1 0 0 0 TEXT TEXT
It sums two
cells with It sums cells
Carefully read the question and answer accordingly. It counts cells with multiple multiple All the listed with values or
What is the function of COUNTIFS? criteria arguments options labels 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Choose the Validation type to be given, to prevent All the listed
duplicate entries of Invoice data in a range of cells Whole number options Custom Decimal Date 0 0 1 0 0 TEXT TEXT
SUMIF
(Sum_range,
Criteria_rang
SUMIF e1,Criteria1,
(Range, Criteria_rang
Carefully read the question and answer accordingly. SUMIF(Number1, None of the Criteria, Sum e2,Criteria2,
Choose the correct syntax of the SUMIF function Number2…) listed options Range) …) 0 0 1 0 TEXT TEXT
Cells
Carefully read the question and answer accordingly. Cells K14 inbetween None of the
K14:K28 Indicates values of : Cells K14 through K28 and K28 only K15 and K27 listed options 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
The method used to get data from a different
worksheet is called as _________________. Accessing Verifying Referencing Functioning 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly.
What is the resultant of the below action? Two rows will Two rows will Two rows will
Select both the rows 3 and 4 in a worksheet and Two rows will be inserted be inserted be inserted be inserted
choose -> Insert -> Insert Sheet Rows after Row 2 after Row 5 after Row 4 after Row 3 1 0 0 0 TEXT TEXT
<a url="http: <a href="http:
//www. //www.
example. example.
Carefully read the question and answer accordingly. com" com"
What is the correct HTML syntax for creating a >example</a >example</a
hyperlink? <a name="">tA</a> > > <a>B</a> 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly.
How can you make a list that lists the items with
numbers? <ul> <ol> <list> <dl> 1 0 0 0 TEXT TEXT
Heading Heading Heading
Carefully read the question and answer accordingly. information is information information is
What does the Web browser assume while using a Heading information is to to appear on has a shown as a
heading tag in a html document? appear in bold letters its own line hyperlink size six 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly. If
you don’t want the frame windows to be resizeable,
simply add what to the lines ? None of the listed options dontresize noresize save 0 0 1 0 TEXT TEXT
<embed <embed <embed
sound="song. src="song. audio="song.
mid" width=" mid" width=" mid" width="
Carefully read the question and answer accordingly. <embed music="song.mid" 500" height=" 500" height=" 500" height="
Choose the right syntax to embed "audio files" in HTML width="500" height="10" > 10" > 10" > 10" > 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly.
Which is the correct syntax to create an Arabic numeric
list <li type="1"> <ol type="1"> <ul type="1"> <il type="1"> 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
When creating a Web document, what format is used
to express an image's height and width? Dots per inch Pixels Inches Centimeters 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly. None of the
how many "browser safe colors"are there? 216 16 Million 256 given options 0 0 1 0 TEXT TEXT
<html><body
><h1 style=" <html><body <html><body
font- ><h1 style=" ><h1 style="
family=verda font-family: font-family:
na;">A verdana;">A verdana;">A
heading</h1> heading</h1> heading</h1>
<p style=" <p style=" <p style="
<html><body><h1 style:" font-family: font-family: font-family:
font-family:verdana;">A arial;color: arial;color: arial,color:
heading</h1><p style:" red;font-size: red;font-size: red;font-size:
font-family:arial;color:red; 20px;">A 20px;">A 20px">A
font-size:20px;">A paragraph. paragraph. paragraph.
Carefully read the question and answer accordingly. paragraph. </p></body> </p></body> </p></body>
Identify the correct code for font,color and size </p></body></html> </html> </html> </html> 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly. Refresh your Redirect to a
What is the REFRESH meta tag used for in html? None of the listed options content new domain rewrite url 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly.
Address of the HTML links are specified in which
attribute? hr br href align 0 0 1 0 TEXT TEXT
It connects
your web site It hides
It specifies formatting and to an programming
Carefully read the question and answer accordingly. layout instructions for your None of the operating instructions
What does a HTML tag do? web page. listed options environment. from view. 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. In
which color is Anchor displayed by default? green blue pink red 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
What is the another way to make text bold besides None of the
<b>? All the listed options <strong> listed options <fat> <dark> 0 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. 1x1 pixel
Rather than using Hspace and Vspace you can use height and transparent
which of the following to add spacing to your image ? None of the listed options width image align=+2 0 0 1 0 TEXT TEXT
<a href="
Carefully read the question and answer accordingly. <mail>@b</ mailto:a@b. <mail href="
How can you create an e-mail link in html? <a href="a@b"> mail> com"> a@b"> 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly.
How many types of lists are there in HTML 3 2 1 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Which of the following is used to increase the row
height in html? cellspacing cellpadding row span col span 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly. <prefor> <pre format>
Which html tag is used to display Preformatted texts? <pre text> </pre text> <pre> </pre> </prefor> </pre format> 0 1 0 0 TEXT TEXT
To display
Carefully read the question and answer accordingly. To provide animation contents of To collect None of the
what is the use of forms in html? effects email users input listed options 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly.
Which of the following is a plain ASCII text file with Action Transaction
embedded HTML commands? Web document document document Web Server 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
What is the most important tool for adding colors to
certain areas of the page rather than the entire None of the
background ? Images Tables Fonts listed options 0 1 0 0 TEXT TEXT
<a href="url" <a href="url"
Carefully read the question and answer accordingly. None of the target=" target="new"
How can you open a link in a new browser window? <a href="url" new> listed options _blank"> > 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly. <ol begin="3"
Which link is used to start a list at the count of 3? None of the listed options > <ol list="5"> <ol start="3"> 0 0 0 1 TEXT TEXT
<img src="
http://www. <img src=" <img src="
google. http://www. http://www.
com/logo. google. google.
<img src="http://www. png" com/logo. com/logo.
Carefully read the question and answer accordingly. google.com/logo.png" alternate png" alt png" alt="
What is the correct syntax to add alternative text for an alternate="Logo of text="Logo of text="Logo of Logo of
image? website"/> website"/> website"/> website"/> 0 0 0 1 TEXT TEXT
Space to the
Carefully read the question and answer accordingly. None of the Space to the top and
Using Hspace will add what to your image ? Height to all sides listed options left and right bottom 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly. <h1
Which of the following is correct to align H1 tag to left <h1 tag align alignment = <h1 align =
alignment? None of the given options = "left"></h1> "left"></h1> "left"></h1> 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
Which tag would be used to display power in expresion
(A+B)2 ? <p> <SUP> <SUB> <b> 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Choose the correct HTML syntax to left-align the <td valign="
content inside a table cell <td align="left"> <tdleft> <td leftalign> left"> 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. A
computer Program that translates one program
instruction at a time into machine language is called
______. Interpreter Compiler CPU Simulator 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. both linking
The process of converting object code into machine and
code is called None of the listed options Compiling compiling Linking 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
The processes of starting or restarting a computer
system by loading instructions from a secondary All the listed
storage device into the computer memory is called Duping Booting Padding options 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Application Software can run independently of the
system software. State True or False true false 0 1 TEXT TEXT
stores data allows the
indefinitely computer to
Carefully read the question and answer accordingly. All the listed unless you store data
What is RAM is a secondary memory options delete it electronically 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly. both static
Multiple programs can share a single copy of the and dynamic dynamic
library. This is an advantage of ______. None of the listed options linking linking Static linking 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly.
System Software can run independently of the
application software. State True or False false true 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
When data needs permanent storage __________ is Storage
chosen. None of the listed options RAM both device 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
Which of the following storage is volatile semiconductor memory CD-ROM floppy disk core memory 1 0 0 0 TEXT TEXT
Converting
the object Converting
Carefully read the question and answer accordingly. Converting the source code into the source
Choose all the major steps involved in a compilation code directly into machine machine code into None of the
process code code object code listed options 0 0.5 0.5 0 TEXT TEXT
Carefully read the question and answer accordingly.
The most commonly used standard data code to
represent alphabetical, numerical and punctuation
characters used in electronic data processing system is All the listed
called EBCDIC ASCII BCD options 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
The term associated with the comparison of processing
speeds of different computer system is: MPG EFTS CPS MIPS 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly. Graphics All the given Microsoft
Choose the Application Softwares from the given list MySQL Driver options Word 0.5 0 0 0.5 TEXT TEXT
constructs
that connects thirty packets of
personnel computers that data and
can provide more controls error send them
Carefully read the question and answer accordingly. computing power than a detection and None of the across the
A local area network is: minicomputer correction given options network 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
What is the address given to a computer connected to
a network called System address IP address SYSID Process ID 0 1 0 0 TEXT TEXT
space
located in the
socket that front of a
peripheral enables computer to
hardware device that device information to install
Carefully read the question and answer accordingly. A allows connection to the attached to a move through additional
port is a Internet computer. a system. drives. 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly. A
logical network that consists of two or more physical
networks WAN Internetwork
Networking LAN 0 1 0 0 TEXT TEXT
SMTP
Carefully read the question and answer accordingly. HTTP
Find all the low level protocols from the given list ICMP ARP 0 0.5 0 0.5 TEXT TEXT
Carefully read the question and answer accordingly.
Which port is a fast connection that is more flexible
than traditional serial and parallel ports? Serial USB Ethernet
Parallel 0 1 0 0 TEXT TEXT
A network
A network with more A network
with more than one exit with only one
Carefully read the question and answer accordingly. A network that has only than one exit and entry entry and no
What is a stub network? one entry and exit point. point. point. exit point. 1 0 0 0 TEXT TEXT
Packets may
Carefully read the question and answer accordingly. Duplicate packets may be arrive out of All the listed A packet may
Why IP protocol is considered as unreliable? generated order options be lost 0 0 1 0 TEXT TEXT
Which of the following is not a Internet connection? DSL WLAN dial-up WWAN 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
How long is an IPv6 address? 64 bits 128 bytes 32 bits 128 bits 0 0 0 1 TEXT TEXT
Circuit
Carefully read the question and answer accordingly. All the listed Cell switched switched
The internet is an example of Packet switched network options network network 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Which tab of task manager in Windows 7 will show
each program you are working on as a Process? Services Processes Process Performance 0 1 0 0 TEXT TEXT
both High
level
Carefully read the question and answer accordingly. (memory) &
___________ uses multiple queues to select the next Low level Low level
process, out of the processes in memory, to get a time High level (memory) (CPU) (CPU) None of the
quantum. scheduler scheduler scheduler listed options 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
State whether True or False.
In Windows 7 the Task Scheduler wizard is used to
create a task that opens the program automatically
according to the schedule you choose. false true 0 1 TEXT TEXT
Make sure
Eliminate To maintain a each process
highs and constant is consumes
Make sure each process is lows in the amount of specific
Carefully read the question and answer accordingly. completed within a processor’s work for the amount of
Which of the following is not goals of scheduling? reasonable time frame workload processor. memory. 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
UNIX uses ___-level scheduling Two one Four Three 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
State whether True or False.
Processes scheduling in which the scheduler selects
tasks to run based on their priority is called Priority
Scheduling. true false 1 0 TEXT TEXT
Carefully read the question and answer accordingly. In
z/OS there are a maximum of ___ name segments
which can make up a data set name 34 44 64 22 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
Which command is used to search for information in a None of the
file or files? search listed options find grep grp 0 0 0 1 0 TEXT TEXT
Carefully read the question and answer accordingly.
___________________, sometimes referred to as file
descriptors, are data structures that hold information File Control Fic Content File Content
about a file. Fix Control Blocks Blocks Blocks Blocks 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
State whether True or False.
The command "mv" is used to move and also rename a
file. false true 0 1 TEXT TEXT
Carefully read the question and answer accordingly. In FILE_NAME_
UNIX a file name may not exceed ___________. None of the options. MAX FILE_MAX NAME_MAX 0 0 0 1 TEXT TEXT
Carefully read the question and answer accordingly.
Which Command is used to find out what directory you
are working in? pwd more ncftp print 1 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly. Only PS &
Which of the following is a valid type of File in z/OS. All PS,PDS & VSAM PS VSAM PDS PDS 1 0 0 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
Which of the following is the Korn shell ( ksh)
initialization script. .kshrcs .kshrc .kcshr .kshc 0 1 0 0 TEXT TEXT
Carefully read the question and answer accordingly.
State whether True or False.
Partitioned Data Set is similar to File in Windows. true false 0 1 TEXT TEXT