programming languages Online Quiz - 63
Description: programming languages Online Quiz - 63 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
What modifiers may be used with an interface declaration
The developer can force garbage collection by calling System.gc().
Assertions are used to enforce all but which of the following?
Which of the following keywords is used to invoke a method in the parent class?
The following line of code is valid. int x = 9; byte b = x;
At first JAVA was named as______ .
A lock can be acquired in a class.
Garbage collection guarantee that a program will not run out of memory.
What is the purpose of the Runtime class?
Which containers may have a MenuBar?
Can a Byte object be cast to a double value?
A class inherit the constructors of its superclass?
Which abstract class is the super class of all classes used for writing characters. Select the one correct answer.
Checked Exceptions are
Which class is the immediate superclass of the Container class?
class test{} class tester extends test{ public static void main(String[] args) { test t1 = new tester(); test t2 = new test(); tester t3 = new tester(); System.out.println( t1 instanceof tester); System.out.println( t2 instanceof tester); System.out.println( t3 instanceof tester); System.out.println( t1 instanceof test); System.out.println( t2 instanceof test); System.out.println( t3 instanceof test); }
public class Fun { public static void main(String[] args){ int x=0; boolean b=true; String str; str=(b)?"success": (x=0)?"Failure":"Neither"; System.out.println(str); } }
class Root { int bark=10; public void get(){ System.out.println("Root"); } } public class Tree extends Root{ public void get(){ bark =15; System.out.println("Tree"); } public static void main(String[] args){ Tree t = new Tree(); Root r = new Root(); Root t1= new Tree(); r.get(); t.get(); t1.get(); System.out.println(t.bark); System.out.println(t1.bark); System.out.println(r.bark); } }
public class Top { private int i; Top(int i) {this.i=i; } public int getValue(){ return this.i; } } class Bottom{ public static void main(String[] args) { Top tp = new Top(5); String j = Integer.toString(tr.getValue()); tp.i=15; System.out.println( tp.i + j); } }
public class Play { public static void main(String[] args) { int[][] a = {{5,2,4,7}, {9,2}, {3,4}}; int[] b = a[1]; int[][] b1= new int[3][]; int a2 = b[2]; System.out.println(a2); } }