0

programming languages Online Quiz - 33

Description: programming languages Online Quiz - 33
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

Can constructors be declared static?

  1. True

  2. False


Correct Option: B

Are static methods allowed to access instance variables using "this"

  1. No

  2. Yes

  3. Can be in special cases

  4. None


Correct Option: A

class C{ int i; public static void main (String[] args) { int i; //1 private int a = 1; //2 protected int b = 1; //3 public int c = 1; //4 System.out.println(a+b+c); //5 }}

  1. Compile error at 2,3,4,5

  2. Compile error at 1,2,3,4,5

  3. prints 3

  4. none of the above


Correct Option: A

class C { public static void main(String[] args) { int i1=1; switch(i1){ case 1: System.out.println("one"); case 2: System.out.println("two"); case 3: System.out.println("three"); }}} What is the result of attempting to compile and run the program?

  1. Prints one, two , three

  2. prints one

  3. compile time error

  4. Run time Exception


Correct Option: A

Which of these below are java key words?

  1. new

  2. break

  3. default

  4. goto


Correct Option: A,B,C

select which of these are correct

  1. int = 32-bit signed

  2. float = 32-bit IEEE 754 floating point

  3. long = 64-bit signed

  4. short = 18-bit signed


Correct Option: A,B,C
  1. public

  2. synchronise

  3. private

  4. transient


Correct Option: A
  1. Conditional operator

  2. assignment operator

  3. bitwise operator

  4. none


Correct Option: A

Which of the following are bit wise operators in java?

  1. ~

  2. <

  3. >>

  4. &&


Correct Option: A,B,C
  1. java.lang.object

  2. java.lang

  3. none

  4. java.lang.string


Correct Option: A
  1. When a class is not to be instantiated,

  2. declare a method without providing the implementation

  3. cannot use a field declared abstract

  4. none


Correct Option: A,B
  1. final

  2. finally

  3. finalize

  4. finalised


Correct Option: D

Using super keywork how many levels up we can go

  1. one level

  2. two levels

  3. multiple levels

  4. none


Correct Option: A
- Hide questions