0
Alien head

programming languages Online Quiz - 33

Description: programming languages Online Quiz - 33
Number of Questions: 20
Created by:
Tags: programming languages

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

  1. True

  2. False

Answer: 1

Can final method be overridden?

  1. True

  2. False

Answer: 2

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

  1. True

  2. False

Answer: 1

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

  1. True

  2. False

Answer: 1

assuming all the variables are declared and initialied properly , will the below line compile? for (i=3,j=76;i>589;j++,i++){}

  1. Yes will compile

  2. no doesnot compile

  3. changes have to be made in checking the variables

  4. none

Answer: 1

Can a private method of a super class be declared in a sub class?

  1. yes

  2. no

  3. cannot say

  4. none

Answer: 1

Using super keywork how many levels up we can go

  1. one level

  2. two levels

  3. multiple levels

  4. none

Answer: 1

Which is not a part of java

  1. final

  2. finally

  3. finalize

  4. finalised

Answer: 4

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

Answer: 1,2

All classes extend from

  1. java.lang.object

  2. java.lang

  3. none

  4. java.lang.string

Answer: 1

The expression to the switch must be of a type

  1. byte/int,

  2. short,

  3. char,

  4. float

Answer: 1,2,3

Which of the following are bit wise operators in java?

  1. ~

  2. <<

  3. &&

Answer: 1,2,3

" ?: " is a

  1. Conditional operator

  2. assignment operator

  3. bitwise operator

  4. none

Answer: 1

A top level class can be marked as

  1. public

  2. synchronise

  3. private

  4. transient

Answer: 1

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

Answer: 1,2,3

Which of these below are java key words?

  1. new

  2. break

  3. default

  4. goto

Answer: 1,2,3

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

Answer: 1

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

Answer: 1

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

  1. No

  2. Yes

  3. Can be in special cases

  4. None

Answer: 1

Can constructors be declared static?

  1. True

  2. False

Answer: 2
+ View questions