JavaBeat Certifications Certifications Kits Articles Interview Questions OCAJP 7 OCPJP 5 OCPJP 6 OCEJWCD 6 SCBCD 5.0 SCEA SCJA
350 Mock Questions on SCJP 1.5 - JUST Rs.250 or 7 USD
Send us mail to sales@javabeat.net
more details

SCJA Mock Questions

Question 1
Which of the given code fragments will compile without errors ?
Select all correct answers :

a. float f=3.5;

b. double d=3.5;

c. int i=10;

d. int e,f=10;

e. char c = "C";
b.,c. and d. are correct.

Question 2
What will be the result of compiling and running the following code ?
abstract class Employee {
String name;
public abstract float calcIncome();
}

class Manager extends Employee {
public void hire(String who) {
System.out.println( who + " hired by " + name );
}

public void fire(String who) {
System.out.println( who + " fired by " + name );
}
}

public class ManagerCheck {
public static void main(String args[]) {
Manager me = new Manager();
me.hire("newbie");
me.fire("nobody");
}
}
Select the correct answer :

a. who hired by name and who fired by name

b. newbie hired by name and nobody fired by name

c. newbie hired by null and nobody fired by null

d. Compilations fails
d. is correct.

Question 3
According to the UML diagram - what is the correct Java representation of Animal and Cat ?
Select the correct answer :

a. class Cat implements Animal { }

b. class Animal extends Cat { }

c. class Animal implements Cat { }

d. class Cat extends Animal { }

e. UML diagram is invalid
d. is correct.

Question 4
Methods defined in a java interface are public and abstract by default.
Select the correct answer :

a. The statement is true.

b. The statement is false.
a. is correct.

Question 5
Which of the following statements about abstract classes in java are true ?
Select all correct answers :

a. A class must be declared abstract if one or more methods are abstract.

b. A class can be declared abstract if one or more methods are abstract.

c. A class can be declared abstract without abstract methods.

d. An abstract class cannot be instanciated.
a.,c. and d. are correct.
350 Mock Questions on SCJP 1.5 - JUST Rs.250 or 7 USD
Send us mail to sales@javabeat.net
more details

javabeat | advertise | about us | contact | useful resources
Copyright (2004 - 2013), JavaBeat