The createNewFile() method of the File class is used to create a new empty file if a file with the…
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);…
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…
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(){…
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)…
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:…
November 17th, 2009
Constructors
No Comments, Java Questions, by Daisy Williams.If a class Student creates two student objects. Which of the following statements are true about its constructors? A: The…
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…
November 12th, 2009
What will be the output of the following program?
No Comments, Java Questions, by Daisy Williams.class Ques{ public static void main (String[] argv){ int p1 = 0102; int p2 = -10; int mod = p1…