Tag: programming languages

Questions Related to programming languages

Which of the following statement is False?

  1. The throw keyword denotes a statement that causes an exception to be initiated

  2. A class that is declared without any access modifiers is said to have package or friendly access

  3. A class inherit the constructors of its superclass

  4. The primitive types are byte, char, short, int, long, float, double, and boolean


Correct Option: C

Which of the following is used to check in particular page the session will be alive or not?

  1. ifAlive()

  2. checkAlive()

  3. isAlive()

  4. None of the above


Correct Option: C

Choose the correct statement from the given choice?

  1. Arrays in Java are essentially objects

  2. It is not possible to assign one array to another. Individual elements of array can however be assigned.

  3. Array elements are indexed from 1 to size of array

  4. If a method tries to access an array element beyond its range, a compile warning is generated.


Correct Option: A

A constructor is used to

  1. Free memory

  2. Initialize a newly created object

  3. Import packages

  4. Create a JVM for applets


Correct Option: B

What does the following expression return? Math.max(Float.POSITIVE_INFINITY,Double.POSITIVE_INFINITY);

  1. Float.POSITIVE_INFINITY

  2. Double.POSITIVE_INFINITY

  3. runtime Exception

  4. None of the Above


Correct Option: B

Select three correct statements

  1. A static method may override another static method

  2. A static method cannot override a non-static method

  3. A non-static method cannot override a static method

  4. A non-static method may be overloaded by a static method

  5. A synchronized method cannot be overridden


Correct Option: A,B,C,D,E