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

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

" ?: " is 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

All classes extend from

  1. java.lang.object

  2. java.lang

  3. none

  4. java.lang.string


Correct Option: A

abstract keyword is used

  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

Which is not a part of java

  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

Using the "Super" keyword we can go one level up (T/F)

  1. True

  2. False


Correct Option: A

" ?: " is a conditional Operator (T/F)

  1. True

  2. False


Correct Option: A

Can final method be overridden?

  1. True

  2. False


Correct Option: B

Can you automatically convert long value into int , if the long value is small enough to fit into an int.

  1. True

  2. False


Correct Option: A
- Hide questions