Java Search Engine

freerice.com

Friday, December 7, 2007

Interview - 2

1. What is the output of the following program?

int b=’A’;

System.out.println(b);


A) 65 B) A C) Compile Time Error D) Runtime Error


2. What is the output of the following program?

String a=new String("Reddy");

StringBuffer b=new StringBuffer("Reddy");

System.out.println(a.equals(b));



A) true B) false C) Compile Time Error D) Runtime Error


3. What is the output of the following program?

String a="Reddy";

a.toUpperCase();

System.out.println(a);

A) REDDY B) Reddy C) Compile Time Error D)Runtime Error


4. Which of the following declarations are wrong?

i. final public class test{}

ii. abstract public class test{}

iii. protected abstract class test{}

iv. public static interface test{}

v. final static interface test{}

A) iii & iv B) iv & v C) i & ii & v D) iii & v


1 comment:

Ratings by outbrain