programming languages Online Quiz - 209
Description: programming languages Online Quiz - 209 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
How long does the following code run? for(int x=0; x=3; x++)
Any class that implements the Runnable interface has to provide the implementation for the following methods public void start(); public void run();
What is the result of trying to compile and run the following code. public final static void main(String[] args){ double d = 10.0 / -0; if(d == Double.POSITIVE_INFINITY) System.out.println("Positive infinity"); else System.out.println("Negative infinity"); }
What is the result that will be printed out ? void aMethod() { float f = (1 / 4) * 10; int i = Math.round(f); System.out.println(i); }
What is the result that will be printed out ? void aMethod() { float f = (1 / 4) * 10; int i = Math.round(f); System.out.println(i); }
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); } }
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)); } }
ZZZ (Duplicate) - Identify whether the following statement is true or false. The finally block is executed when an exception is thrown, even if no catch matches it.
ZZZ (Duplicate) - What is the output of the following, StringBuffer sb1 = new StringBuffer("Debopam"); StringBuffer sb2= new StringBuffer("Debopam "); String ss1 = " Debopam "; System.out.println(sb1==sb2); System.out.println(sb1.equals(sb2)); System.out.println(sb1.equals(ss1)); System.out.println("Poddar".substring(3));
Identify whether the following statement is true or false.
The keyword synchronized can be used with only a method
Identify whether the following statement is true or false.
The run () method should necessary exist in classes created as subclass of Thread
What is the purpose of the toolkit in the Abstract Window Toolkit (AWT)?
What is an interface class?
Vertical and horizontal scroll bar increments are how many units by default?
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?
The StringBuffer class supports what type of strings?
Handling an exception allows a program to terminate execution
Java's exception handling mechanism keeps error-processing code in the main line of a program's code to improve program clarity.
Identify the correct examples of Exception