Jai solanki

Ssc

37 Questions

Questions

Question 1 Multiple Choice (Single Answer)

Overriding and Overloading is for ?

  1. Methods and variables
  2. class
  3. variables
  4. Methods
Question 2 Multiple Choice (Single Answer)

Overriding and Overloading is for ?

  1. Methods and variables
  2. class
  3. variables
  4. Methods
Question 3 Multiple Choice (Single Answer)

Which one of these lists contains only Java programming language keywords?

  1. class, if, void, long, Int, continue
  2. goto, instanceof, native, finally, default, throws
  3. try, virtual, throw, final, volatile, transient
  4. strictfp, constant, super, implements, do
Question 4 Multiple Choice (Single Answer)

Which one of these lists contains only Java programming language keywords?

  1. class, if, void, long, Int, continue
  2. goto, instanceof, native, finally, default, throws
  3. try, virtual, throw, final, volatile, transient
  4. strictfp, constant, super, implements, do
Question 5 Multiple Choice (Single Answer)

Which will legally declare, construct, and initialize an array?

  1. int [] myList = {"1", "2", "3"};
  2. int [] myList = (5, 8, 2);
  3. int myList [] [] = {4,9,7,0};
  4. int myList [] = {4, 3, 7};
Question 6 Multiple Choice (Single Answer)

Which will legally declare, construct, and initialize an array?

  1. int [] myList = {"1", "2", "3"};
  2. int [] myList = (5, 8, 2);
  3. int myList [] [] = {4,9,7,0};
  4. int myList [] = {4, 3, 7};
Question 7 Multiple Choice (Single Answer)

Which is a reserved word in the Java programming language?

  1. method
  2. native
  3. subclasses
  4. reference
Question 8 Multiple Choice (Single Answer)

Which is a reserved word in the Java programming language?

  1. method
  2. native
  3. subclasses
  4. reference
Question 9 Multiple Choice (Single Answer)

Which is a valid keyword in java?

  1. interface
  2. string
  3. Float
  4. unsigned
Question 10 Multiple Choice (Single Answer)

Which is a valid keyword in java?

  1. interface
  2. string
  3. Float
  4. unsigned
Question 11 Multiple Choice (Single Answer)

Which one of the following will declare an array and initialize it with five numbers?

  1. Array a = new Array(5);
  2. int [] a = {23,22,21,20,19};
  3. int a [] = new int[5];
  4. int [5] array;
Question 12 Multiple Choice (Single Answer)

Which one of the following will declare an array and initialize it with five numbers?

  1. Array a = new Array(5);
  2. int [] a = {23,22,21,20,19};
  3. int a [] = new int[5];
  4. int [5] array;
Question 13 Multiple Choice (Single Answer)

Which is the valid declarations within an interface definition?

  1. public double methoda();
  2. public final double methoda();
  3. static void methoda(double d1);
  4. protected void methoda(double d1);
Question 14 Multiple Choice (Single Answer)

Which is the valid declarations within an interface definition?

  1. public double methoda();
  2. public final double methoda();
  3. static void methoda(double d1);
  4. protected void methoda(double d1);
Question 15 Multiple Choice (Single Answer)

Which one is a valid declaration of a boolean?

  1. boolean b1 = 0;
  2. boolean b2 = 'false';
  3. boolean b3 = false;
  4. boolean b4 = Boolean.false();
Question 16 Multiple Choice (Single Answer)

Which one is a valid declaration of a boolean?

  1. boolean b1 = 0;
  2. boolean b2 = 'false';
  3. boolean b3 = false;
  4. boolean b4 = Boolean.false();
Question 17 Multiple Choice (Single Answer)

Which one is a valid declaration of a boolean?

  1. boolean b1 = 0;
  2. boolean b2 = 'false';
  3. boolean b3 = false;
  4. boolean b4 = Boolean.false();
Question 18 Multiple Choice (Single Answer)

Which is a valid declarations of a String?

  1. String s1 = null;
  2. String s2 = 'null';
  3. String s3 = (String) 'abc';
  4. String s4 = (String) '\ufeed';
Question 19 Multiple Choice (Single Answer)

Which is a valid declarations of a String?

  1. String s1 = null;
  2. String s2 = 'null';
  3. String s3 = (String) 'abc';
  4. String s4 = (String) '\ufeed';
Question 20 Multiple Choice (Single Answer)

Which is a valid declarations of a String?

  1. String s1 = null;
  2. String s2 = 'null';
  3. String s3 = (String) 'abc';
  4. String s4 = (String) '\ufeed';
Question 21 Multiple Choice (Single Answer)

Which is a valid declarations of a String?

  1. String s1 = null;
  2. String s2 = 'null';
  3. String s3 = (String) 'abc';
  4. String s4 = (String) '\ufeed';
Question 22 Multiple Choice (Single Answer)

Which is a valid declarations of a String?

  1. String s1 = null;
  2. String s2 = 'null';
  3. String s3 = (String) 'abc';
  4. String s4 = (String) '\ufeed';
Question 23 Multiple Choice (Single Answer)

What is the numerical range of a char?

  1. -128 to 127
  2. -(215) to (215) - 1
  3. 0 to 32767
  4. 0 to 65535
Question 24 Multiple Choice (Single Answer)

What is the numerical range of a char?

  1. -128 to 127
  2. -(215) to (215) - 1
  3. 0 to 32767
  4. 0 to 65535
Question 25 Multiple Choice (Single Answer)

What is the numerical range of a char?

  1. -128 to 127
  2. -(215) to (215) - 1
  3. 0 to 32767
  4. 0 to 65535
Question 26 Multiple Choice (Single Answer)

What is the numerical range of a char?

  1. -128 to 127
  2. -(215) to (215) - 1
  3. 0 to 32767
  4. 0 to 65535
Question 27 Multiple Choice (Single Answer)

You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

  1. public
  2. protected
  3. private
  4. transient
Question 28 Multiple Choice (Single Answer)

You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

  1. public
  2. protected
  3. private
  4. transient
Question 29 Multiple Choice (Single Answer)

What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?

  1. public
  2. abstract
  3. protected
  4. synchronized
  5. default access
Question 30 Multiple Choice (Single Answer)

Which cause a compiler error?

  1. int[ ] scores = {3, 5, 7};
  2. int [ ][ ] scores = {2,7,6}, {9,3,45};
  3. String cats[ ] = {"Fluffy", "Spot", "Zeus"};
  4. boolean results[ ] = new boolean [] {true, false, true};
Question 31 Multiple Choice (Single Answer)

You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?

  1. public
  2. private
  3. protected
  4. default access
Question 32 Multiple Choice (Single Answer)

Which one creates an instance of an array?

  1. int[ ] ia = new int[15];
  2. float fa = new float[20];
  3. char[ ] ca = "Some String";
  4. int ia[ ] [ ] = { 4, 5, 6 }, { 1,2,3 };
Question 33 Multiple Choice (Single Answer)

Which of the following class level (nonlocal) variable declarations will not compile?

  1. protected int a;
  2. transient int b = 3;
  3. private synchronized int e;
  4. volatile int d;
Question 34 Multiple Choice (Single Answer)

Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?

  1. final
  2. static
  3. private
  4. protected
Question 35 Multiple Choice (Single Answer)

Which is a valid declaration within an interface?

  1. public static short stop = 23;
  2. protected short stop = 23;
  3. transient short stop = 23;
  4. final void madness(short stop);
Question 36 Multiple Choice (Single Answer)

Suppose that you would like to create an instance of a new Map that has an iteration order that is the same as the iteration order of an existing instance of a Map. Which concrete implementation of the Map interface should be used for the new instance?

  1. TreeMap
  2. HashMap
  3. LinkedHashMap
  4. The answer depends on the implementation of the existing instance.
Question 37 Multiple Choice (Single Answer)

Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object?

  1. java.lang.String
  2. java.lang.Double
  3. java.lang.StringBuffer
  4. java.lang.Character