0 of 25 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 25 Questions answered correctly
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
How many primitive types are there in Java? Could you name them?
Does Java support unsigned numeric types?
Which of the following declarations are not correct and why?
public interface SomeInterface { private void firstMethod(); // #1 void secondMethod(); // #2 protected void thirdMethod(); // #3 final void fourthMethod(); //#4 }
Can we extend an enum in Java?
What is the default type of floating-point literals in Java?
Will the following code compile?
byte a = 1; a += 5; byte c = a + 2;
Is the code snippet below correct?
class SomeClass{ abstract void someMethod(); }
Can the main method be overloaded? Which method will be invoked when the following program starts?
class SomeClass{ public static void main(String[] args) {} public static void main(String[] args, int a) {} }
How many varargs arguments can a method take?
Is the following code snippet correct?
void someMethod(String… someVararg, int b) {}
Can we mark a class as protected?
What will be the result of the following code?
private void someMethod() { int a; System.out.print(a); }
Can an overriding method have a more restrictive access modifier?
class ClassOne{ void someMethod() {} } class ClassTwo extends ClassOne{ private void someMethod() {} }
Can static methods be overridden?
Can we mark a class as abstract even if it doesn’t contain any abstract method?
abstract SomeClass{ public void someMethod() {} }
Can we access a static member of the class using an object reference variable?
class SomeClass{ static int someMethod(){ return 5; } } class AnotherClass{ void someMethod(){ SomeClass someClass = new SomeClass(); someClass.someMethod(); } }
Which of the following lines contains the correct array declaration?
class SomeClass{ String[] arrayOne; // #1 String arrayTwo[]; // #2 }
How many access control levels does Java have? Please name them.
Will the following code snippet compile?
class SomeClass{ int[5] name; }
Which of the following can we use with an instance variable?
What will be the output here?
int[] arr = {1,2,3,4,5}; int x = 10; for( int x : arr ) System.out.print(x);
Which 3 modifiers cannot be used with “abstract”?
What will be printed here?
String s = “Some”; int a = 1; int b = 2; System.out.print(s + a + b);
What will be the output of the following code?
String a = “Some”; a.concat(“ String"); System.out.print(a);
Are local variables a part of the stack or a heap?
To make Codersee work, we log user data. By using our site, you agree to our Privacy Policy and Terms of Use.