0
Alien head

programming languages Online Quiz - 250

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

The following interface is valid. public interface Marker { }

  1. True

  2. False


Correct Option: A

which of these is false?

  1. a class implements one or more interfaces

  2. a class extends one or more interfaces

  3. an interface extends one of more interfaces

  4. Serializable is a marker Interface


Correct Option: B

Abstract class's can have a constructor.

  1. True

  2. False


Correct Option: A

An Interface can only have public members whereas an abstract class can contain private as well as protected members

  1. True

  2. False


Correct Option: A

All variables in an Interface are by default __________.

  1. public

  2. final

  3. static

  4. all the above

  5. there should not be any variable in an interface


Correct Option: D

The variable "g_nWheels" follows the Hungarian notation.

  1. True

  2. False


Correct Option: B

Given the above scenario, the variable name "aulColors" represents:

  1. an array of unsigned long

  2. an array of floating-point values

  3. an array of unary

  4. an array of zero-terminated strings


Correct Option: A

"fBusy" represents a variable of the following data type:

  1. floating-point

  2. double

  3. boolean

  4. function


Correct Option: C

Based on Simonyi's convention, the notation "w" implies:

  1. a byte

  2. a word

  3. a boolean

  4. a null-terminated string


Correct Option: B

Based on the description above, we could say that the variable name "lAccountNum" follows the Systems Hungarian Notation.

  1. True

  2. False


Correct Option: A

What gets printed here... System.out.println("Sum of 5 and 3 is:"+5+3);

  1. Sum of 5 and 3 is:8

  2. error during compilation

  3. Sum of 5 and 3 is:53

  4. None of these


Correct Option: C

Consider the following declarations ... float f = 4.5; //1 double d = 9.22; //2 short s = 3; //3 char c = s; //4 Which lines will throw error if any?

  1. 1 and 4

  2. 1

  3. 2 and 3

  4. 3 and 4

  5. no error


Correct Option: A

int i=5; int a = + --i/2.0;

  1. Does not compile saying binary operator has invalid use

  2. 2.0

  3. 2.5

  4. exception will be thrown


Correct Option: B

Checked Exceptions are

  1. all sub-classes of Throwable

  2. not the sub classes of RuntimeException

  3. all sub-classes of Error

  4. None of these


Correct Option: B

Which of the following are valid main method declarations?

  1. static public void main(String []args)

  2. public static void main(String heyhey[])

  3. public static int main(String[] args)

  4. public static void main(String ...args)

  5. public static void main (String [], int argv)


Correct Option: A,B,D

The main method has to be "public static" because of the following reasons. (Two options)

  1. static because it has to be constant and cannot be changed.

  2. static because it has to be loaded by the JVM without instantiating it

  3. public because other classes may also call the main method of a class

  4. public because JVM has to have access to the main method in order to call it.


Correct Option: B,D

Java is a

  1. Iterpreted Language

  2. Compiled Language

  3. Byte Code Language

  4. None of these


Correct Option: D

class P { public void doIt() {} } class C extends P { private void doIt() {}} It is not legal.

  1. True

  2. False


Correct Option: A

we cannot override a non-abstract method as abstract.

  1. True

  2. False


Correct Option: B

Overridden method is in child class and Overriding method is in parent class.

  1. True

  2. False


Correct Option: B
+ View questions