Description: programming languages Online Quiz - 63 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
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); } }
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); } }
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 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 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); }
Which class is the immediate superclass of the Container class?
Checked Exceptions are
Which abstract class is the super class of all classes used for writing characters. Select the one correct answer.
A class inherit the constructors of its superclass?
Can a Byte object be cast to a double value?
Which containers may have a MenuBar?
What is the purpose of the Runtime class?
Garbage collection guarantee that a program will not run out of memory.
A lock can be acquired in a class.
At first JAVA was named as______ .
The following line of code is valid. int x = 9; byte b = x;
Which of the following keywords is used to invoke a method in the parent class?
Assertions are used to enforce all but which of the following?
The developer can force garbage collection by calling System.gc().
What modifiers may be used with an interface declaration