SCJP Certification

Sun Certified Java Programmer Certification exam essentials

Archive for the ‘Java Questions’ Category

December 12th, 2009

What is the createNewFile() method of the File class?

No Comments, Java Questions, by Daisy Williams.

The createNewFile() method of the File class is used to create a new empty file if a file with the…

Share

December 5th, 2009

What will be the output of the following code?

No Comments, Java Questions, by Daisy Williams.

class TestInstanceof { public static void main(String[] args) { Integer i=5; Boolean b; b=(i instanceof Integer); System.out.print(b); b=(i instanceof Number);…

Share

December 4th, 2009

Which of the following operations are allowed for collection framework?

No Comments, Java Questions, by Daisy Williams.

A: Adding objects to a collection B: Iterating through a collection C: Finding out if an object is in a…

Share

December 3rd, 2009

What will be the output of the following program code?

No Comments, Java Questions, by Daisy Williams.

import java.util.*; public class TestArray{ public static void main(String[] args){ TestArray test = new TestArray(); test.go(); } public void go(){…

Share

November 24th, 2009

What will be the output of the following program code?

No Comments, Java Questions, by Daisy Williams.

public class Exc { public static void main(String args[]) { int x1=0; try { int x3= 100/x1; } catch(ArithmeticException e)…

Share

November 23rd, 2009

What will be the output of the following program code?

No Comments, Java Questions, by Daisy Williams.

class Ques0357{ public static void main(String[] argv){ int s = 2; switch (s) { case 1: System.out.println(“Fred”); break; case 2:…

Share

November 16th, 2009

What will be the result while compiling and running the code?

No Comments, Java Questions, by Daisy Williams.

import java.util.EnumSet; public final class EnumMeg { public static void main(String[] args) { Integer i = null; method(i); } static…

Share