Skip to main content

Posts

Showing posts from 2016

MCQ Test-1

MCQ Test Series Test-1 -------------------------------------------------------------------------------------- 1. Which of the following is FALSE about the Singleton Class? A. It provides the private constructor only. B. It provides a static factory method to return the instance of the class. C. It provides a public static reference of the same class type. D. None of These 2. What will be the output:   class Continue {      public static void main(String args[]){            for(int i=0; i<5; i++) {                         System.out.print(i + " ");                         if (i%2 == 0) continue;                         System.out.print("No Continue ");                  }            }   } A. 0 1 No Continue 2 No Continue3 4 B. 0 1 No Continue 2 3 No Continue 4 C. 0 No Continue 1 2 No Continue 3 4 D. Compilation Error 3. What will be the output? public class Test{       public static void main(String args[])

Determine the Output of the following Programs:

class Test {    Test(int a, double l)     {         System.out.println("First");     }    Test(int a, float l)     {         System.out.println("Second");     }    public static void main(String [] rk)     {         Test t = new Test(4, 5);     } } --------------------------------------------------------------------- class Test {    Test(int a, long l)     {         System.out.println("First");     }    Test(int a, float l)     {         System.out.println("Second");     }    public static void main(String [] rk)     {         Test t = new Test(4, 5);     } }