0

programming languages Online Quiz - 209

Description: programming languages Online Quiz - 209
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0
  1. Compiler error.

  2. Compiles and runs printing out 2

  3. Compiles and runs printing out 1

  4. An ArrayIndexOutOfBounds Exception at runtime


Correct Option: B

What will happen if you try to compile and run this ? public class Test{ static{ print(10); } static void print(int x){ System.out.println(x); System.exit(0); } }

  1. . Compiler error.

  2. Will throw a NoSuchMethod error at runtime.

  3. It will compile and run printing out "10"

  4. It will run with no output.


Correct Option: B

What is the value of d that will be printed out. public class Test { public final static void main(String[] args) { double d = - 22.22222; System.out.println(Math.ceil(d)); } }

  1. -23

  2. -22.0

  3. 22.0

  4. 24


Correct Option: B

Identify whether the following statement is true or false.
The keyword synchronized can be used with only a method

  1. True

  2. False


Correct Option: A

Identify whether the following statement is true or false.
The run () method should necessary exist in classes created as subclass of Thread

  1. True

  2. False


Correct Option: A

What is the purpose of the toolkit in the Abstract Window Toolkit (AWT)?

  1. To repair broken frames

  2. To create custom components

  3. An interface between the abstract window layer and windowing implementation

  4. To facilitate multicolor printing


Correct Option: C

What is an interface class?

  1. A collection of method declarations and constant values

  2. An abstract base class

  3. A way to get multiple inheritance

  4. A way to inherit variables and method implementations


Correct Option: A

Vertical and horizontal scroll bar increments are how many units by default?

  1. 12.5 units

  2. 100 units

  3. 5 units

  4. 1 unit


Correct Option: D

Reflection (introspection) is querying a class about its properties, and operating on methods and fields by the name for a given object instance. Why is reflection possible in the Java language?

  1. Late binding

  2. Early binding

  3. Java developers are very introspective people

  4. Reflection is possible in all languages


Correct Option: A

The StringBuffer class supports what type of strings?

  1. Mutable (changeable)

  2. Immutable (unchangeable)

  3. Violins and cellos

  4. Rotated and scaled


Correct Option: A
  1. The Java language has loose type checking

  2. The Java language has tight type checking

  3. To keep tabs on garbage collection

  4. You never know how many you need, so you should always cover the most obvious cases


Correct Option: B

Identify the correct examples of Exception

  1. Divide by zero error

  2. Accessing the elements of an array beyond its range

  3. Invalid input

  4. Opening an empty file

  5. Hard disk crash


Correct Option: A,B,C,E
- Hide questions