Core Java-Mcqs Modified
Core Java-Mcqs Modified
class One{
int var1;
One (int x){
var1 = x;
}}
class Derived extends One{
int var2;
void display(){
AccesCo
System.out.println("var 1="+var1+"var2="+var2);
}}
class Main{
public static void main(String[] args){
Derived obj = new Derived();
obj.display();
}}
consider the code above & select the proper output from the options.
class MyClass1
{
private int area(int side)
{
return(side * side);
}
public static void main(String args[ ])
AccesCo
{
MyClass1 MC = new MyClass1( );
int area = MC.area(50);
System.out.println(area);
}
}
What would be the output?
class Sample
{int a,b;
Sample()
{ a=1; b=2;
System.out.println(a+"\t"+b);
}
Sample(int x)
{ this(10,20);
a=b=x;
System.out.println(a+"\t"+b);
}
Sample(int a,int b)
AccesCo{ this();
this.a=a;
this.b=b;
System.out.println(a+"\t"+b);
}
}
class This2
{ public static void main(String args[])
{
Sample s1=new Sample (100);
}
}
What is the Output of the Program?
Given:
public class Yikes {
What will be the result when you attempt to compile this program?
public class Rand{
public static void main(String argv[]){
int iRand;
AccesSi
iRand = Math.random();
System.out.println(iRand);
}
}
AccesSi Which of the following declarations are correct? (Choose TWO)
class A, B and C are in multilevel inheritance hierarchy repectively . In the
AccesSi main method of some other class if class C object is created, in what
sequence the three constructors execute?
What will be the result when you try to compile and run the following code?
private class Base{
Base(){
int i = 100;
System.out.println(i);
}
}
AccesSi
public class Pri extends Base{
static int i = 200;
public static void main(String argv[]){
Pri p = new Pri();
System.out.println(i);
}
}
public class Q {
public static void main(String argv[]) {
int anar[] = new int[] { 1, 2, 3 };
AccesSi
System.out.println(anar[1]);
}
}
Which statements, when inserted at (1), will not result in compile-time errors?
public class ThisUsage {
int planets;
static int suns;
AccesSi public void gaze() {
int i;
// (1) INSERT STATEMENT HERE
}
}
Given the following code what will be output?
public class Pass{
static int j=20;
public static void main(String argv[]){
int i=10;
Pass p = new Pass();
p.amethod(i);
System.out.println(i);
AccesSi
System.out.println(j);
}
class Order{
Order(){
System.out.println("Cat");
}
public static void main(String... Args){
System.out.println("Ant");
}
AccesSi
static{
System.out.println("Dog");
}
{
System.out.println("Man");
}}
consider the code above & select the proper output from the options.
public class c123 {
private c123() {
System.out.println("Hellow");
}
public static void main(String args[]) {
c123 o1 = new c123();
c213 o2 = new c213();
}
AccesCo
}
class c213 {
private c213() {
System.out.println("Hello123");
}
}
class A {
int i, j;
A(int a, int b) {
i = a;
j = b;
}
void show() {
System.out.println("i and j: " + i + " " + j);
}
}
class B extends A {
int k;
Given:
package QB;
class Meal {
Meal() {
System.out.println("Meal()");
}
}
class Cheese {
Cheese() {
System.out.println("Cheese()");
}
}
class Lunch extends Meal {
Lunch() {
System.out.println("Lunch()");
}
AccesCo}
class PortableLunch extends Lunch {
PortableLunch() {
System.out.println("PortableLunch()");
}
}
class Sandwich extends PortableLunch {
private Cheese c = new Cheese();
public Sandwich() {
System.out.println("Sandwich()");
}
}
public class MyClass7 {
public static void main(String[] args) {
new Sandwich();
}
} What would be the output?
package QB;
class Sphere {
protected int methodRadius(int r) {
System.out.println("Radious is: "+r);
return 0;
}
}
AccesSi package QB;
public class MyClass {
public static void main(String[] args) {
double x = 0.89;
Sphere sp = new Sphere();
// Some code missing
}
} to get the radius value what is the code of line to be added ?
class Test{
static void method(){
this.display();
}
static display(){
System.out.println(("hello");
AccesSi
}
public static void main(String[] args){
new Test().method();
}
}
consider the code above & select the proper output from the options.
Consider the following code and choose the best option:
class Super{ int x; Super(){x=2;}}
class Sub extends Super { void displayX(){
AccesCo
System.out.print(x);}
public static void main(String args[]){
new Sub().displayX();}}
What will happen when you attempt to compile and run this code?
abstract class Base{
abstract public void myfunc();
public void another(){
System.out.println("Another method");
}
}
When we use both implements & extends keywords in a single java program
Inheri Me
then what is the order of keywords to follow?
Consider the code below & select the correct ouput from the options:
1. public class Mountain {
2. protected int height(int x) { return 0; }
3. }
4. class Alps extends Mountain {
5. // insert code here
6. }
Inheri Me
Which five methods, inserted independently at line 5, will compile? (Choose
three.)
A. public int height(int x) { return 0; }
B. private int height(int x) { return 0; }
C. private int height(long x) { return 0; }
D. protected long height(long x) { return 0; }
E. protected long height(int x) { return 0; }
Consider the following code and choose the correct option:
class A{
void display(byte a, byte b){
System.out.println("sum of byte"+(a+b)); }
Inheri Me
void display(int a, int b){
System.out.println("sum of int"+(a+b)); }
public static void main(String[] args) {
new A().display(3, 4); }}
Given:
11. class ClassA {}
12. class ClassB extends ClassA {}
13. class ClassC extends ClassA {}
and:
Inheri Me21. ClassA p0 = new ClassA();
22. ClassB p1 = new ClassB();
23. ClassC p2 = new ClassC();
24. ClassA p3 = new ClassB();
25. ClassA p4 = new ClassC();
Which TWO are valid? (Choose two.)
Consider the following code and choose the correct option:
class A{
void display(){ System.out.println("Hello A"); }}
class B extends A{
void display(){
Inheri Me
System.out.println("Hello B"); }}
public class Test {
public static void main(String[] args) {
B b=(B) new A();
b.display(); }}
Inheri MeA class Animal has a subclass Mammal. Which of the following is true:
Given:
interface DeclareStuff {
public static final int Easy = 3;
void doStuff(int t); }
public class TestDeclare implements DeclareStuff {
public static void main(String [] args) {
int x = 5;
Inheri Me
new TestDeclare().doStuff(++x);
}
void doStuff(int s) {
s += Easy + ++s;
System.out.println("s " + s);
}
} What is the result?
Inheri MeWhich of the following is correct for an abstract class. (Choose TWO)
Day d;
BirthDay bd = new BirthDay("Raj", 25);
Inheri Me
d = bd; // Line X
Where Birthday is a subclass of Day. State whether the code given at Line X
is correct:
class Animal {
void makeNoise() {System.out.println("generic noise"); }
}
class Dog extends Animal {
void makeNoise() {System.out.println("bark"); }
void playDead() { System.out.println("roll over"); }
}
Inheri Me
class CastTest2 {
public static void main(String [] args) {
Animal a = new Dog();
a.makeNoise();
}
}
consider the code above & select the proper output from the options.
interface Vehicle{
void drive();
}
final class TwoWheeler implements Vehicle{
int wheels = 2;
public void drive(){
System.out.println("Bicycle");
}
}
Inheri Meclass ThreeWheeler extends TwoWheeler{
public void drive(){
System.out.println("Auto");
}}
class Test{
public static void main(String[] args){
ThreeWheeler obj = new ThreeWheeler();
obj.drive();
}}
consider the code above & select the proper output from the options.
Given:
Inheri Mepublic static void main( String[] args ) { SomeInterface x; ... }
Can an interface name be used as the type of a variable
Given :
What would be the result of compiling and running the following program?
// Filename: MyClass.java
public class MyClass {
public static void main(String[] args) {
C c = new C();
System.out.println(c.max(13, 29));
}
}
Inheri Me
class A {
int max(int x, int y) { if (x>y) return x; else return y; }
}
class B extends A{
int max(int x, int y) { return super.max(y, x) - 10; }
}
class C extends B {
int max(int x, int y) { return super.max(x+10, y+10); }
}
Given:
interface A { public void methodA(); }
interface B { public void methodB(); }
interface C extends A,B{ public void methodC(); } //Line 3
class D implements B {
public void methodB() { } //Line 5
Inheri Co}
class E extends D implements C { //Line 7
public void methodA() { }
public void methodB() { } //Line 9
public void methodC() { }
}
What would be the result?
Inheri MeSelect the correct statement:
class Animal {
void makeNoise() {System.out.println("generic noise"); }
}
class Dog extends Animal {
void makeNoise() {System.out.println("bark"); }
void playDead() { System.out.println("roll over"); }
}
Inheri Me
class CastTest2 {
public static void main(String [] args) {
Dog a = (Dog) new Animal();
a.makeNoise();
}
}
consider the code above & select the proper output from the options.
Consider the code below & select the correct ouput from the options:
class Money {
private String country = "Canada";
Inheri Mepublic String getC() { return country; } }
class Yen extends Money {
public String getC() { return super.country; }
public static void main(String[] args) {
System.out.print(new Yen().getC() ); } }
Which Man class properly represents the relationship "Man has a best friend
who is a Dog"?
A)class Man extends Dog { }
Inheri Me
B)class Man implements Dog { }
C)class Man { private BestFriend dog; }
D)class Man { private Dog bestFriend; }
Given a derived class method which overrides one of it’s base class methods.
Inheri Me
With derived class object you can invoke the overridden base method using:
Given the following classes and declarations, which statements are true?
// Classes
class Foo {
private int i;
public void f() { /* ... */ }
public void g() { /* ... */ }
}
Inheri Me
class Bar extends Foo {
public int j;
public void g() { /* ... */ }
}
// Declarations:
Foo a = new Foo();
Bar b = new Bar();
class SomeException {
}
class A {
Inheri Me
public void doSomething() { }
}
class B extends A {
public void doSomething() throws SomeException { }
}
Given:
class A {
final void meth() {
System.out.println("This is a final method.");
}
}
class B extends A {
void meth() {
System.out.println("Illegal!");
Inheri Co }
}
class MyClass8{
public static void main(String[] args) {
A a = new A();
a.meth();
B b= new B();
b.meth();
}
}What would be the result?
Consider the code below & select the correct ouput from the options:
abstract class Ab{ public int getN(){return 0;}}
class Bc extends Ab{ public int getN(){return 7;}}
class Cd extends Bc { public int getN(){return 47;}}
class Test{
Inheri Mepublic static void main(String[] args) {
Cd cd=new Cd();
Bc bc=new Cd();
Ab ab=new Cd();
System.out.println(cd.getN()+" "+
bc.getN()+" "+ab.getN()); }}
Given:
interface DoMath
{
double getArea(int r);
}
Inheri Meinterface MathPlus
{
double getVolume(int b, int h);
}
/* Missing Statements ? */
Select the correct missing statements.
interface interface_1 {
void f1();
}
class Class_1 implements interface_1 {
void f1() {
System.out.println("From F1 funtion in Class_1 Class");
}
Inheri Me
}
public class Demo1 {
public static void main(String args[]) {
Class_1 o11 = new Class_1();
o11.f1();
}
}
interface A{}
class B implements A{}
class C extends B{}
public class Test extends C{
Inheri Mepublic static void main(String[] args) {
C c=new C();
/* Line6 */}}
Given the following classes and declarations, which statements are true?
// Classes
class A {
private int i;
public void f() { /* ... */ }
public void g() { /* ... */ }
}
Inheri Meclass B extends A{
public int j;
public void g() { /* ... */ }
}
// Declarations:
A a = new A();
B b = new B();
Select the three correct answers.
Inheri MeWhich of the following statements is true regarding the super() method?
Consider the code below & select the correct ouput from the options:
class Mountain{
int height;
protected Mountain(int x) { height=x; }
public int getH(){return height;}}
Inheri Me
class Alps extends Mountain{
public Alps(int h){ super(h); }
public Alps(){ this(100); }
public static void main(String[] args) {
System.out.println(new Alps().getH());
}
}
class SuperClass
{
public Integer getLength()
{
return new Integer(4);
}
}
What is the result of attempting to compile and run the following code?
import java.util.Vector; import java.util.LinkedList; public class Test1{ public
static void main(String[] args) { Integer int1 = new Integer(10); Vector vec1 =
new Vector(); LinkedList list = new LinkedList(); vec1.add(int1); list.add(int1);
CollecMe
if(vec1.equals(list)) System.out.println("equal"); else System.out.println("not
equal"); } } 1. The code will fail to compile. 2. Runtime error due to
incompatible object comparison 3. Will run and print "equal". 4. Will run and
print "not equal".
Which collection class allows you to grow or shrink its size and provides
CollecSi indexed access to
its elements, but its methods are not synchronized?
Which statement is true about the following program?
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class WhatISThis {
public static void main(String[] na){
List<StringBuilder> list=new ArrayList<StringBuilder>();
CollecMe
list.add(new StringBuilder("B"));
list.add(new StringBuilder("A"));
list.add(new StringBuilder("C"));
Collections.sort(list,Collections.reverseOrder());
System.out.println(list.subList(1,2));
}
}
Given:
public class Venus {
public static void main(String[] args) {
int [] x = {1,2,3};
int y[] = {4,5,6};
new Venus().go(x,y);
CollecSi
}
void go(int[]... z) {
for(int[] a : z)
System.out.print(a[0]);
}
} What is the result?
Consider the code below & select the correct ouput from the options:
public class Test{
public static void main(String[] args) {
String []colors={"orange","blue","red","green","ivory"};
CollecMe
Arrays.sort(colors);
int s1=Arrays.binarySearch(colors, "ivory");
int s2=Arrays.binarySearch(colors, "silver");
System.out.println(s1+" "+s2); }}
Consider the following code was executed on June 01, 1983. What will be the
output?
class Test{
public static void main(String args[]){
CollecMe
Date date=new Date();
SimpleDateFormat sd;
sd=new SimplpeDateFormat("E MMM dd yyyy");
System.out.print(sd.format(date));}}
Consider the following code and choose the correct option:
class Data{ Integer data; Data(Integer d){data=d;}
public boolean equals(Object o){return true;}
public int hasCode(){return 1;}}
class Test{
public static void main(String ar[]){
CollecMe Set<Data> s=new HashSet<Data>();
s.add(new Data(4));
s.add(new Data(2));
s.add(new Data(4));
s.add(new Data(1));
s.add(new Data(2));
System.out.print(s.size());}}
Given:
public static Iterator reverse(List list) {
Collections.reverse(list);
return list.iterator();
}
public static void main(String[] args) {
CollecSi
List list = new ArrayList();
list.add("1"); list.add("2"); list.add("3");
for (Object obj: reverse(list))
System.out.print(obj + ", ");
}
What is the result?
Given:
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
System.out.println(set.equals(set2));
}
} What is the result of given code?
import java.util.StringTokenizer;
class ST{
public static void main(String[] args){
String input = "Today is$Holiday";
CollecSi
StringTokenizer st = new StringTokenizer(input,"$");
while(st.hasMoreTokens()){
System.out.println(st.nextElement());
}}
int indexOf(Object o) - What does this method return if the element is not
CollecSi
found in the List?
Consider the following code and choose the correct option:
class Test{
public static void main(String args[]){
Integer arr[]={3,4,3,2};
CollecMe
Set<Integer> s=new TreeSet<Integer>(Arrays.asList(arr));
s.add(1);
for(Integer ele :s){
System.out.println(ele); } }}
Inorder to remove one element from the given Treeset, place the appropriate
line of code
public class Main {
public static void main(String[] args) {
TreeSet<Integer> tSet = new TreeSet<Integer>();
System.out.println("Size of TreeSet : " + tSet.size());
tSet.add(new Integer("1"));
CollecSi
tSet.add(new Integer("2"));
tSet.add(new Integer("3"));
System.out.println(tSet.size());
// remove the one element from the Treeset
System.out.println("Size of TreeSet after removal : " + tSet.size());
}
}
A)Property files help to decrease coupling
B) DateFormat class allows you to format dates and times with customized
styles.
CollecMe
C) Calendar class allows to perform date calculation and conversion of dates
and times between timezones.
D) Vector class is not synchronized
CollecSi Which interface does java.util.Hashtable implement?
Consider the following code and choose the correct option:
public static void before() {
Set set = new TreeSet();
set.add("2");
set.add(3);
CollecSi
set.add("1");
Iterator it = set.iterator();
while (it.hasNext())
System.out.print(it.next() + " ");
}
Given:
import java.util.*;
Which collection class allows you to access its elements by associating a key
CollecSi
with an element's value, and provides synchronization?
Consider the following code and select the correct output:
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class Lists {
public static void main(String[] args) {
List<String> list=new ArrayList<String>();
list.add("1");
CollecMelist.add("2");
list.add(1, "3");
List<String> list2=new LinkedList<String>(list);
list.addAll(list2);
list2 =list.subList(2,5);
list2.clear();
System.out.println(list);
}
}
Given:
public static Collection get() {
Collection sorted = new LinkedList();
sorted.add("B"); sorted.add("C"); sorted.add("A");
return sorted;
}
CollecSi
public static void main(String[] args) {
for (Object obj: get()) {
System.out.print(obj + ", ");
}
}
What is the result?
You wish to store a small amount of data and make it available for rapid
access. You do not have a need for the data to be sorted, uniqueness is not
an issue and the data will remain fairly static Which data structure might be
most suitable for this requirement?
CollecMe
1) TreeSet
2) HashMap
3) LinkedList
4) an array
Given:
10. interface A { void x(); }
11. class B implements A {
public void x() { }
public void y() { } }
12. class C extends B {
public void x() {} }
And:
CollecMe
20. java.util.List<a> list = new java.util.ArrayList</a>();
21. list.add(new B());
22. list.add(new C());
23. for (A a:list) {
24. a.x();
25. a.y();;
26. }
What is the result?
Object get(Object key) - What does this method return if the key is not found
CollecSi
in the Map?
Consider the code below & select the correct ouput from the options:
public class Test {
public static void main(String[] args) {
KeywoMe
String[] elements = { "for", "tea", "too" };
String first = (elements.length > 0) ?elements[0] : null;
System.out.println(first); }}
class Test{
public static void main(String[] args){
byte b=(byte) (45 << 1);
KeywoMe
b+=4;
System.out.println(b); }}
What should be the output for the code written above?
What is the value of y when the code below is executed?
KeywoMeint a = 4;
int b = (int)Math.ceil(a % 3 + a / 3.0);
}
}
What will be the result of the following program?
public class Init {
String title;
boolean published;
static int total;
static double maxPrice;
public static void main(String[] args) {
KeywoMeInit initMe = new Init();
double price;
if (true)
price = 100.00;
System.out.println("|" + initMe.title + "|" + initMe.published + "|" +
Init.total + "|" + Init.maxPrice + "|" + price+ "|");
}
}
class C{
public static void main (String[] args) {
byte b1=33; //1
b1++; //2
KeywoMebyte b2=55; //3
b2=b1+1; //4
System.out.println(b1+""+b2);
}}
Consider the code above & select the correct output.
What will be the output of the program?
int value = 0;
KeywoMe
int count = 1;
value = count++ ;
System.out.println("value: "+ value + " count: " + count);
What will be the output of the program?
class Test{
public static void main(String[] args){
int var;
KeywoMevar = var +1;
System.out.println("var ="+var);
}}
consider the code above & select the proper output from the options.
KeywoMeWhich of the following will declare an array and initialize it with five numbers?
KeywoMeWhich three are legal array declarations? (Choose THREE)
Consider the code below & select the correct ouput from the options:
class Test{
public static void main(String[] args) {
parse("Four"); }
static void parse(String s){
KeywoMe
try {
double d=Double.parseDouble(s);
}catch(NumberFormatException nfe){
d=0.0; }finally{
System.out.println(d); } }}
Consider the code below & select the correct ouput from the options:
class A{
public int a=7;
public void add(){
this.a+=2; System.out.print("a"); }}
int a = 0;
KeywoMeint b = 10;
a = --b ;
System.out.println("a: " + a + " b: " + b );
What will happen if you attempt to compile and run the following code?
Integer ten=new Integer(10);
Long nine=new Long (9);
KeywoMe
System.out.println(ten + nine);
int i=1;
System.out.println(i + ten);
Which of the following lines of code will compile without warning or error?
1) float f=1.3;
2) char c="a";
KeywoMe
3) byte b=257;
4) boolean b=null;
5) int i=10;
Consider the code below & select the correct ouput from the options:
Given
class MybitShift
{
public static void main(String [] args)
{
KeywoMe int a = 0x5000000;
System.out.print(a + " and ");
a = a >>> 25;
System.out.println(a);
}
}
1. public class LineUp {
2. public static void main(String[] args) {
3. double d = 12.345;
4. // insert code here
5. }
6. }
KeywoMe
Which code fragment, inserted at line 4, produces the output | 12.345|?
State the class relationship that is being implemented by the following code:
class Employee
{
private int empid;
private String ename;
public double getBonus()
{
Accounts acc = new Accounts();
KeywoMe
return acc.calculateBonus();
}
}
class Accounts
{
public double calculateBonus(){//method's code}
}
Say that class Rodent has a child class Rat and another child class Mouse.
Class Mouse has a child class PocketMouse. Examine the following
Rodent rod;
KeywoMeRat rat = new Rat();
Mouse mos = new Mouse();
PocketMouse pkt = new PocketMouse();
How many objects and reference variables are created by the following lines
of code?
KeywoMeEmployee emp1, emp2;
emp1 = new Employee() ;
Employee emp3 = new Employee() ;
Consider the code below & select the correct ouput from the options:
What will be the result when you attempt to compile and run the following
code?.
public class Conv
{
public static void main(String argv[]){
Conv c=new Conv();
String s=new String("ello");
c.amethod(s);
String Co
}
EqTest(){
String s="Java";
String s2="java";
String Co
// Line X
{
System.out.println("Equal");
}else
{
System.out.println("Not equal");
}
}
}
Given:
public class Theory {
public static void main(String[] args) {
String s1 = "abc";
String s2 = s1;
s1 += "d";
System.out.println(s1 + " " + s2 + " " + (s1==s2));
String Co
StringBuffer sb1 = new StringBuffer("abc");
StringBuffer sb2 = sb1;
sb1.append("d");
System.out.println(sb1 + " " + sb2 + " " + (sb1==sb2));
}
}
Which are true? (Choose all that apply.)
after line 11 runs, how many objects are eligible for garbage collection?
Given :
public class MainOne {
public static void main(String args[]) {
String str = "this is java";
System.out.println(removeChar(str,'s'));
}
int count = 1;
while ( ___________ )
{
System.out.print( count + " " );
ControMe count = count + 1;
}
System.out.println( );
12345678
Given:
public class Breaker2 {
static String o = "";
public static void main(String[] args) {
z:
for(int x = 2; x < 7; x++) {
if(x==3) continue;
ControMe
if(x==5) break z;
o = o + x;
}
System.out.println(o);
}
}
What is the result?
Consider the following code and choose the correct option:
class Test{
public static void main(String args[]){
ControMe
String hexa = "0XFF";
int number = Integer.decode(hexa);
System.out.println(number); }}
Given:
class Atom {
Atom() { System.out.print("atom "); }
}
class Rock extends Atom {
Rock(String type) { System.out.print(type); }
}
ControMepublic class Mountain extends Rock {
Mountain() {
super("granite ");
new Rock("granite ");
}
public static void main(String[] a) { new Mountain(); }
}
What is the result?
Given:
public class Barn {
public static void main(String[] args) {
new Barn().go("hi", 1);
new Barn().go("hi", "world", 2);
ControMe}
public void go(String... y, int x) {
System.out.print(y[y.length - 1] + " ");
}
}
What is the result?
Given:
int n = 10;
switch(n)
{
case 10: n = n + 1;
case 15: n = n + 2;
ControMe
case 20: n = n + 3;
case 25: n = n + 4;
case 30: n = n + 5;
}
System.out.println(n);
What is the value of ’n’ after executing the following code?
Given:
public void go() {
String o = "";
z:
for(int x = 0; x < 3; x++) {
for(int y = 0; y < 2; y++) {
if(x==1) break;
ControMe
if(x==2 && y==1) break z;
o = o + x + y;
}
}
System.out.println(o);
}
What is the result when the go() method is invoked?
class Test{
public static void main(String[] args) {
int x=-1,y=-1;
if(++x=++y)
System.out.println("R.T. Ponting");
ControMe
else
System.out.println("C.H. Gayle");
}
}
consider the code above & select the proper output from the options.
Given:
public class Batman {
int squares = 81;
public static void main(String[] args) {
new Batman().go();
}
ControMevoid go() {
incr(++squares);
System.out.println(squares);
}
void incr(int squares) { squares += 10; }
}
What is the result?
Consider the code below & select the correct ouput from the options:
public class Test{
public static void main(String[] args) {
String num="";
z: for(int x=0;x<3;x++)
ControMe
for(int y=0;y<2;y++){
if(x==1) break;
if(x==2 && y==1) break z;
num=num+x+y;
}System.out.println(num);}}
Given:
public static void test(String str) {
int check = 4;
if (check = str.length()) {
System.out.print(str.charAt(check -= 1) +", ");
} else {
System.out.print(str.charAt(0) + ", ");
ControMe
}
}
and the invocation:
test("four");
test("tee");
test("to");
What is the result?
int I = 0;
outer:
while (true)
{
I++;
inner:
for (int j = 0; j < 10; j++)
{
I += j;
ControMe
if (j == 3)
continue inner;
break outer;
}
continue outer;
}
System.out.println(I);
What is the range of the random number r generated by the code below?
ControMe
int r = (int)(Math.floor(Math.random() * 8)) + 2;
int i = 10;
ControMe Integer iOb = 100;
i = iOb;
System.out.println(i + " " + iOb);
}
} whether this code work properly, if so what would be the result?
Which of the following loop bodies DOES compute the product from 1 to 10
like (1 * 2 * 3 * 4 * 5 *
6 * 7 * 8 * 9 * 10)?
int s = 1;
ControMe
for (int i = 1; i <= 10; i++)
{
<What to put here?>
}
Which of the following statements are true regarding wrapper classes?
ControMe
(Choose TWO)
import java.util.SortedSet;
import java.util.TreeSet;
Given:
public class Test {
public enum Dogs {collie, harrier, shepherd};
public static void main(String [] args) {
Dogs myDog = Dogs.shepherd;
switch (myDog) {
case collie:
System.out.print("collie ");
ControMe
case default:
System.out.print("retriever ");
case harrier:
System.out.print("harrier ");
}
}
}
What is the result?
Given:
double height = 5.5;
if(height-- >= 5.0)
System.out.print("tall ");
if(--height >= 4.0)
System.out.print("average ");
ControMe
if(height-- >= 3.0)
System.out.print("short ");
else
System.out.print("very short ");
}
What would be the Result?
System.out.println("the prize.");
what will be the result of attempting to compile and run the following class?
Public class IFTest{
public static void main(String[] args){
int i=10;
if(i==10)
ControMe
if(i<10)
System.out.println("a");
else
System.out.println("b");
}}
Given:
static void myFunc()
{
int i, s = 0;
for (int j = 0; j < 7; j++) {
i = 0;
do {
ControMe
i++;
s++;
} while (i < j);
}
System.out.println(s);
}
} What would be the result
switch(x)
{
default:
System.out.println("Hello");
}
Which of the following are acceptable types for x?
ControMe
1.byte
2.long
3.char
4.float
5.Short
6.Long
What is the output :
class One{
public static void main(String[] args) {
int a=100;
if(a>10)
ControMe System.out.println("M.S.Dhoni");
else if(a>20)
System.out.println("Sachin");
else if(a>30)
System.out.println("Virat Kohli");}
}
Given:
public class Test {
public enum Dogs {collie, harrier};
public static void main(String [] args) {
Dogs myDog = Dogs.collie;
switch (myDog) {
case collie:
ControMe
System.out.print("collie ");
case harrier:
System.out.print("harrier ");
}
}
}
What is the result?
What will be the output of following code?
import java.util.*;
class I
{
public static void main (String[] args)
ControMe {
Object i = new ArrayList().iterator();
System.out.print((i instanceof List)+",");
System.out.print((i instanceof Iterator)+",");
System.out.print(i instanceof ListIterator);
}
}
Given:
int a = 5;
int b = 5;
int c = 5;
if (a > 3)
if (b > 4)
if (c > 5)
ControMe
c += 1;
else
c += 2;
else
c += 3;
c += 4;
What is the value of variable c after executing the following code?
Given:
Float pi = new Float(3.14f);
if (pi > 3) {
System.out.print("pi is bigger than 3. ");
}
else {
ControMe
System.out.print("pi is not bigger than 3. ");
}
finally {
System.out.println("Have a nice day.");
}
What is the result?
Given:
int x = 0;
int y = 10;
do {
ControMey--;
++x;
} while (x < 5);
System.out.print(x + "," + y);
What is the result?
What are the thing to be placed to complete the code?
class Wrap {
public static void main(String args[]) {
Introd MeWhich of the following options give the valid package names? (Choose 3)
Which of the following options give the valid argument types for main()
Introd Me
method? (Choose 2)
Which of the following option gives one possible use of the statement 'the
Introd Me
name of the public class should match with its file name'?
Which of the following classes can be used to create the target, so that the
preceding code compiles correctly?
What will be the output of the program?
Threa MeWhich of the following methods are defined in class Thread? (Choose TWO)
Threa Si wait(), notify() and notifyAll() methods belong to ________
Consider the following code and choose the correct option:
class A implements Runnable{ int k;
public void run(){
Threa Si k++; }
public static void main(String args[]){
A a1=new A();
a1.run();}
class PingPong2 {
synchronized void hit(long n) {
for(int i = 1; i < 3; i++)
System.out.print(n + "-" + i + " ");
}
}
public class Tester implements Runnable {
Threa Si static PingPong2 pp2 = new PingPong2();
public static void main(String[] args) {
new Thread(new Tester()).start();
new Thread(new Tester()).start();
}
public void run() { pp2.hit(Thread.currentThread().getId()); }
}
Which statement is true?
Given:
public class Threads4 {
public static void main (String[] args) {
new Threads4().go();
}
public void go() {
Runnable r = new Runnable() {
public void run() {
Threa Si System.out.print("run");
}
};
Thread t = new Thread(r);
t.start();
t.start();
}
}
What is the result?
A) Multiple processes share same memory location
B) Switching from one thread to another is easier than switching from one
Threa Si process to another
C) Thread makes it possible to maximize resource utilization
D) Process is a light weight program
class Thread2 {
public static void main(String[] args) {
new Thread2().go(); }
public void go(){
Runnable rn=new Runnable(){
Threa Si public void run(){
System.out.println("Good Day.."); } };
Thread t=new Thread(rn);
t.start();
}}
what should be the correct output for the code written above?
Threa Si wait(2000);
After calling this method, when will the thread A become a candidate to get
another turn at the CPU?
A) Exception is the superclass of all errors and exceptions in the java
Threa Si language
B) RuntimeException and its subclasses are unchecked exception.
Select the variable which are in java.lang.annotation.RetentionPolicy class.
Annot Si
(Choose THREE)
Annot Si Custom annotations can be created using
Annot Si Choose the meta annotations. (Choose THREE)
All annotation types should maually extend the Annotation interface. State
Annot Si
TRUE/FALSE
If no retention policy is specified for an annotation, then the default policy of
Annot Si
__________ is used.
Annot Si Select the Uses of annotations. (Choose THREE)
Intro Si Which of the following is not an attribute of object?
Intro Si What is the advantage of runtime polymorphism?
Intro Si Which of the following is an example of IS A relationship?
Intro Si Which of following set of functions are example of method overloading
Intro Si Which of the following is not a valid relation between classes?
ExceptSi Choose the correct option:
System.out.print("Start ");
try
{
System.out.print("Hello world");
throw new FileNotFoundException();
}
System.out.print(" Catch Here "); /* Line 7 */
catch(EOFException e)
ExceptCo{
System.out.print("End of file exception");
}
catch(FileNotFoundException e)
{
System.out.print("File not found");
}
Given:
public class ExceptionTest
{
class TestException extends Exception {}
public void runTest() throws TestException {}
ExceptSi public void test() /* Line X */
{
runTest();
}
}
At Line X, which code is necessary to make the code compile?
Consider the following code and choose the correct option:
class Test{
public static void parse(String str) {
try { int num = Integer.parseInt(str);
ExceptCo
} catch (NumberFormatException nfe) {
num = 0; } finally { System.out.println(num);
} } public static void main(String[] args) {
parse("one"); }
class Trial{
public static void main(String[] args){
try{
System.out.println("One");
int y = 2 / 0;
System.out.println("Two");
}
ExceptSi
catch(RuntimeException ex){
System.out.println("Catch");
}
finally{
System.out.println("Finally");
}
}}
Given:
static void test() {
try {
String x = null;
System.out.print(x.toString() + " ");
}
ExceptSi finally { System.out.print("finally "); }
}
public static void main(String[] args) {
try { test(); }
catch (Exception ex) { System.out.print("exception "); }
}
What is the result?
class PropagateException{
public static void main(String[] args){
try{
method();
System.out.println("method() called");
}
catch(ArithmeticException ex){
System.out.println("Arithmetic Exception");
ExceptSi
}
catch(RuntimeException re){
System.out.println("Runtime Exception");
}}
static void method(){
int y = 2 / 0;
}}
consider the code above & select the proper output from the options.
The exceptions for which the compiler doesn’t enforce the handle or declare
ExceptSi
rule
1.Error
2.Event
ExceptSi
3.Object
4.Throwable
5.Exception
6.RuntimeException
class Test{
public static void main(String[] args){
try{
Integer.parseInt("1.0");
}
catch(Exception e){
ExceptSi System.out.println("Exception occurred");
}
catch(RuntimeException ex){
System.out.println("RuntimeException");
}
}}
consider the code above & select the proper output from the options.
Consider the code below & select the correct ouput from the options:
public class Test{
Integer i;
int x;
Test(int y){
ExceptSi x=i+y;
System.out.println(x);
}
public static void main(String[] args) {
new Test(new Integer(5));
}}
Given:
public class TestSeven extends Thread {
private static int x;
public synchronized void doThings() {
int current = x;
current++;
ExceptSi x = current;
}
public void run() {
doThings();
}
}
Which statement is true?
Given:
class X { public void foo() { System.out.print("X "); } }
1.notify();
2.notifyAll();
3.isInterrupted();
ExceptSi
4.synchronized();
5.interrupt();
6.wait(long msecs);
7.sleep(long msecs);
8.yield();
public class RTExcept
{
public static void throwit ()
{
System.out.print("throwit ");
throw new RuntimeException();
}
public static void main(String [] args)
{
try
{
System.out.print("hello ");
ExceptCo throwit();
}
catch (Exception re )
{
System.out.print("caught ");
}
finally
{
System.out.print("finally ");
}
System.out.println("after ");
}
}
What will happen when you attempt to compile and run the following code?
public class Bground extends Thread{
public static void main(String argv[]){
Bground b = new Bground();
b.run();
}
ExceptSi
public void start(){
for (int i = 0; i <10; i++){
System.out.println("Value of i = " + i);
}
}
}
Given two programs:
1. package pkgA;
2. public class Abc {
3. int a = 5;
4. protected int b = 6;
5. public int c = 7;
6. }
3. package pkgB;
ExceptCo4. import pkgA.*;
5. public class Def {
6. public static void main(String[] args) {
7. Abc f = new Abc();
8. System.out.print(" " + f.a);
9. System.out.print(" " + f.b);
10. System.out.print(" " + f.c);
11. }
12. }
What is the result when the second program is run? (Choose all that apply)
try
{
int x = 0;
int y = 5 / x;
}
catch (Exception e)
ExceptSi
{
System.out.println("Exception");
}
catch (ArithmeticException ae)
{
System.out.println(" Arithmetic Exception");
}
System.out.println("finished");
Given:
11. class A {
12. public void process() { System.out.print("A,"); }
13. class B extends A {
14. public void process() throws IOException {
15. super.process();
16. System.out.print("B,");
ExceptSi
17. throw new IOException();
18. }
19. public static void main(String[] args) {
20. try { new B().process(); }
21. catch (IOException e) { System.out.println("Exception"); }
22. }
What is the result?
Consider the following code and choose the correct option:
public class Test {
public static void main(String[] args) {
File file=new File("D:/jlist.lst");
byte buffer[]=new byte[(int)file.length()+1];
IO OpMe
FileInputStream fis=new FileInputStream(file);
fis.read(buffer);
System.out.println(buffer);
}
}
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
public class MoreEndings {
public static void main(String[] args) {
try {
FileInputStream fis = new FileInputStream("seq.txt");
InputStreamReader isr = new InputStreamReader(fis);
int i = isr.read();
while (i != -1) {
System.out.print((char)i + "|");
IO OpMei = isr.read();
}
} catch (FileNotFoundException fnf) {
System.out.println("File not found");
} catch (EOFException eofe) {
System.out.println("End of stream");
} catch (IOException ioe) {
System.out.println("Input error");
}
}
}
Assume that the file "seq.txt" exists in the current directory, has the required
access permissions, and contains the string "Hello".
Which statement about the program is true?
Consider the following code and choose the correct output:
public class Person{
public void talk(){ System.out.print("I am a Person "); }
}
public class Student extends Person {
public void talk(){ System.out.print("I am a Student "); }
}
IO OpMe
what is the result of this piece of code:
public class Test{
public static void main(String args[]){
Person p = new Student();
p.talk();
}
}
Which of these are two legal ways of accessing a File named "file.tst" for
reading. Select the correct option:
A)FileReader fr = new FileReader("file.tst");
IO OpMe
B)FileInputStream fr = new FileInputStream("file.tst");
C)InputStreamReader isr = new InputStreamReader(fr, "UTF8");
D)FileReader fr = new FileReader("file.tst", "UTF8");
What happens when the constructor for FileInputStream fails to open a file for
IO OpMe
reading?
import java.io.*;
public class MyClass implements Serializable {
Which of the following opens the file "myData.stuff" for output first deleting
IO OpMe
any file with that name?
A file is readable but not writable on the file system of the host platform. What
will
IO OpMe
be the result of calling the method canWrite() on a File object representing
this file?
import java.io.*;
public class MyClass implements Serializable {
private int a;
public int getA() { return a; }
publicMyClass(int a){this.a=a; }
private void writeObject( ObjectOutputStream s)
IO OpMethrows IOException {
// insert code here
}
}
Which code fragment, inserted at line 15, will allow Foo objects to be
correctly serialized and deserialized?
A) When one use callablestatement, in that case only parameters are send
JDBC Meover network not sql query.
B) In preparestatement sql query will compile for first time only
JDBC Si getConnection() is method available in?
Which method will return boolean when we try to execute SQL Query from a
JDBC Si
JDBC program?
An application can connect to different Databases at the same time. State
JDBC Si
TRUE/FALSE.
A) By default, all JDBC transactions are auto commit
B) PreparedStatement suitable for dynamic sql and requires one time
JDBC Si
compilation
C) with JDBC it is possible to fetch information about the database
class CreateFile{
public static void main(String[] args) {
try {
File directory = new File("c"); //Line 13
File file = new File(directory,"myFile");
if(!file.exists()) {
JDBC Mefile.createNewFile(); //Line 16
}}
catch(IOException e) {
e.printStackTrace }
}}}
If the current direcory does not consists of directory "c", Which statements
are true ? (Choose TWO)
while (rs.next()) {
String name = rs.getString("name");
JDBC Me
System.out.println(name);
}
rs.close();
// somecode
} What should be imported related to ResultSet?
Consider the following code & select the correct option for output.
String sql ="select empno,ename from emp";
PreparedStatement pst=cn.prepareStatement(sql);
JDBC Me
System.out.println(pst.toString());
ResultSet rs=pst.executeQuery();
System.out.println(rs.getString(1)+ " "+rs.getString(2));
JDBC Si What is the default type of ResultSet in JDBC applications?
Consider the code below & select the correct ouput from the options:
Given :
public class MoreEndings {
public static void main(String[] args) throws Exception {
JDBC Si Class driverClass = Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
DriverManager.registerDriver((Driver) driverClass.newInstance());
// Some code
} Inorder to compile & execute this code, what should we import?
o.exe();
}
}
Carefully read the question and answer accordingly.
AccessMe
Which of the following are true about constructors?
try
ExceptCo
{
}
catch(IOException t)
{
System.out.println("B");
}
System.out.println("C");
}
}
code compiles fine and will display 23 code compiles but will not display output
compile error Man Dog Cat Ant
i = this.planets; i = this.suns;
Error: amethod parameter does not match
10 and 40
variable
The compiler will automatically change the The compiler will find the error and will not
private variable to a public variable make a .class file
String: String first, int: 11 int: 99, String: Int int: 27, String: Int first String: String first, int:
first 27
methodRadius(x); sp.methodRadius(x);
default public
It is not possible to declare a constructor
Hello
private
System.out.println(Math.ceil(-4.7)); System.out.println(Math.floor(-4.7));
synchronized volatile
true false
The code will compile and run, printing out The compiler will complain that the Base
the words "My Func" class has non abstract methods
Compilation fails. Cannot add Toppings
we must use always extends and later we we must use always implements and later we
must use implements keyword. must use extends keyword.
3 4
Legal at compile time, but might be illegal at
Illegal at compile time
runtime
A,B,E A,C,D
sum of byte 7 Compilation error
A Compilation error
class Vehicle { abstract void display(); } abstract Vehicle { abstract void display(); }
p0 = p1; p2 = p4;
Hello A Compilation error
Because of single inheritance, Mammal can Because of single inheritance, Mammal can
have no subclasses have no other parent than Animal
s 14 s 16
A Compilation error
No—a variable must always be an object No—a variable must always be an object
reference type reference type or a primitive type
A B
This is a final method illegal This is a final method Some error message
000 47 7 0
class AllMath extends DoMath { double interface AllMath implements MathPlus
getArea(int r); } { double getVol(int x, int y); }
B b=c; A a2=(B)c;
4, 4 4, 5
run time exception compile time error
1 2
java.util.HashSet java.util.LinkedHashSet
The program will compile and print the The program will compile and print the
following output: [B] following output: [B,A]
1 12
2 -4 3 -5
Integer Long
3, 2, 1, 1, 2, 3,
true false
Today is Holiday Today is Holiday
null -1
Java.util.Map Java.util.List
The before() method will print 1 2 The before() method will print 1 2 3
java.util.SortedMap java.util.TreeMap
[1,3,2] [1,3,3,2]
A, B, C, B, C, A,
1 2
Compilation fails because of an error in line
The code runs with no output.
25
[2,3,7,5] [2,3,4,5,6]
-1
value = value + sum; sum = sum + 1; sum = sum + 1; value = value + sum;
int [] myList = {"1", "2", "3"}; int [] myList = (5, 8, 2);
48 94
1 2
A sequence of five 10's are printed A sequence of Garbage Values are printed
The program will compile, and print |null| The program will compile, and print |null|true|
false|0|0.0|0.0|, when run 0|0.0|100.0|, when run
4 Compilation error
10, 1 11, 1
3 Compilation error
13 13.5
-1
Compilation error
t7 t9
x = -7, y = 1, z = 5 x = 3, y = 2, z = 6
10, 9, 8, 7, 6, 9, 8, 7, 6, 5,
10, 1 11, 1
a: 9 b:11 a: 10 b: 9
26 282
19 followed by 11 19 follwed by 20
23 13
disp X = 6 main X=6 disp X = 5 main X=5
06172838 06172839
Compilation error
Two objects and three reference variables. Three objects and two reference variables
92 91
false true
10 27
result =
result.concat( stringA, stringB, stringC );
stringA.concat( stringB.concat( stringC ) );
K A
Compilation and output the string "Hello" Compilation and output the string "ello"
result =
result.concat( stringA, stringB, stringC );
stringA.concat( stringB.concat( stringC ) );
203 204
acctna iccratna
if(s==s2) if(s.equals(s2))
bat at
78abc abc78
acitcratna acitrcratna
hi hi hi world
4 2
Cognizant Technology Solutions Cognizant Technology
One ring to rule them all, One ring to find One ring to rule them all, One ring to find
them. them.
-6 6
tica anta
788232 7914
1
A B
x.delete() x.finalize()
An object is deleted as soon as there are no The finilize() method will eventually be called
more references that denote the object on every object
2 24
Compilation error 1515
hi hi hi world
23 32
00 0001
012 012122
true false
R.T.Ponting C.H.Gayle
81 91
7 Compilation error
value = 6 value = 4
An exception is thrown at runtime. [608, 610, 612, 629] [608, 610, 629]
0001 000120
x=1 x=3
r, t, t, r, e, o,
TreeMap HashSet
b = nf.parse( input ); b = nf.format( input );
3 2
There are syntax errors on lines 1 and 6 There are syntax errors on lines 1, 6, and 8
5,6 6,5
s += i * i; s++;
tSet.headSet tset.headset
one two three four four three two one
23 Compilation error
harrier shepherd
14 28
2211 3 2 1 null
good good morning morning ….
2 and 4 1 ,3 and 5
M.S.Dhoni all of these
collie harrier
Prints: false, false, false Prints: false, false, true
123 3
9 5
Compilation fails. pi is bigger than 3.
Compilation fails j = -1
5,6 5,5
int, int Integer, new
dollorpack.$pack.$$pack $$.$$.$$
run() notify()
Thread class none of the listed options
The output could be 6-1 6-2 5-1 7-1 The output could be 5-1 6-1 6-2 5-2
start(); register();
METHOD SOURCE
@interface @inherit
Override Retention
true false
method class
Code output: Start Hello world End of file Code output: Start Hello world Catch Here
exception. File not found.
Any statement that can throw an Error must Any statement that can throw an Exception
be enclosed in a try block. must be enclosed in a try block.
True False
The notifyAll() method must be called from a To call sleep(), a thread must own the lock on
synchronized context the object
If run with no arguments,the program will If run with no arguments,the program will
produce no output produce "The end"
static methods are difficult to maintain, static methods can be called using an object
because you can not change their reference to an object of the class in which
implementation. this method is defined.
ClassCastException NumberFormatException
sleep() yield()
bark meow
caught exit exit
Deadlock will not occur if wait()/notify() is The wait() method is overloaded to accept a
used duration
prints 12 12 12 12 DeadLock
ClassCastException NullPointerException
volatile synchronized
hello throwit caught Compilation fails
5 Compilation error
true false
Compilation fails
The program will only print 5 The program will only print 1 and 4 in order
1, 2, 4 2, 4, 5
hello throwit caught finally after hello throwit caught
A compile time error indicating that no run A run time error indicating that no run method
method is defined for the Thread class is defined for the Thread class
567 5 followed by an exception
finished Exception
Exception A,B,Exception
reads data from file named jlist.lst in byte
Compilation error
form and display it on console.
The program will not compile because a The program will compile and print H|e|l|l|o|
certain unchecked exception is not caught. Input error.
I am a Person I am a Student
A,D B,C
writeBytes() writeFloat()
The file system has a new empty directory The file system has a new empty directory
named dir named newDir
writes data to file in byte form. Compilation error
s.writeInt(x); s.serialize(x);
Statement CallableStatement
executeUpdate() executeSQL()
true false
There is no such method in ResultSet It returns true when last read column contain
interface SQL NULL else returns false
true false
java.sql.ResultSet java.sql.Driver
java.sql.Driver java.sql.Driver
Database.getMaxConnections Connection.getMaxConnections
executeAll() executeAllSQL()
true false
registerDriver() method Class.forName()
specifier Inheritance
TRUE FALSE
FALSE TRUE
Class Public
FALSE TRUE
super class exe method sub class display super class exe method super class display
method method
Constructors can be overloaded Constructors can be overridden.
TRUE FALSE
TRUE FALSE
1&2 1&2&3
Child Parent Parent
1&2 1&3
TRUE FALSE
TRUE FALSE
final protected
Class cannot be defined inside another class Runtime Error.
TRUE FALSE
10 50 20 50
TRUE FALSE
TRUE FALSE
TRUE FALSE
TRUE FALSE
TRUE FALSE
TRUE FALSE
TRUE FALSE
TRUE FALSE
0, 0, 0 120, 60, 0
DigiCam do Charge You are Sending:
Compilation Error
MyFamily.jpg
The equals method does NOT properly Compilation fails because the private attribute
override the Object class's equals method. p.name cannot be accessed.
Aggregation Composition
System.free(); System.setGarbageCollection();
line 3 line 4
Both Statements A and B are true Statement A is true and Statement B is false
Option 2 Option 3
address dot
97 a
1 3
TRUE FALSE
try catch
TRUE FALSE
102 34
FALSE TRUE
12,12,-1 13,12,0
extends implements
class new
III->I->II->IV. I->III->II->IV
An exception is thrown at runtime. The code executes normally and prints "Run".
TRUE FALSE
It will compile and the run method will print It will compile and calling start will print out
out the increasing value of i. the increasing value of i.
TRUE FALSE
You cannot call run() method using Thread
An exception is thrown at runtime.
class object.
Exactly 10 seconds after the start method is Exactly 10 seconds after the “Start!” is
called, “Time’s Over!” will be printed. printed, “Time’s Over!” will be printed.
Runnable Running
1&2 1&3
One Two
wait() notify()
[10,abc] [10]
1&2 1&3
List Set
TRUE FALSE
TRUE FALSE
boolean void
The Iterator interface declares only three The ListIterator interface extends both the
methods: hasNext, next and remove. List and Iterator interfaces
int String
FALSE TRUE
TRUE FALSE
TRUE FALSE
java.utill.Map java.util.ArrayList
Serializable SortTable
TRUE FALSE
The elements in the collection are accessed The elements in the collection are
using a unique key. guaranteed to be unique
TRUE FALSE
Both the Statements A and B are true Statement A is true and Statement B is false
A B
TRUE FALSE
TRUE FALSE
TRUE FALSE
True False
TRUE FALSE
1&2 1&3
Both Statements A and B are true Statement A is true and Statement B is false
comparator compare
FALSE TRUE
TRUE FALSE
TRUE FALSE
TRUE FALSE
TRUE FALSE
FALSE TRUE
FALSE TRUE
TRUE FALSE
4 5
x = JAVA x=""
1&2 1&2&3
welcome error
IOException compilation error
TRUE FALSE
1&2 1&2&3
TRUE FALSE
TRUE FALSE
TRUE FALSE
TRUE FALSE
Throwable throws
1&2 1&3
An exception which is not handled by a catch
A catch block can have another try block
block will be handled by subsequent catch
nested inside
blocks
TRUE FALSE
Executing try After try Executing catch Executing try Runtime Exception
2 3
hello 0 stopped hello 0 Math problem occur stopped
try finally
A,C A
IOException Throwable
try final
Compiler time error User defined exceptions
Prints Exception
should extend Exception
FALSE TRUE
TRUE FALSE
1&2 1&5
Try block always needed a catch block if exception occurs, control switches to
followed following first Catch block
TRUE FALSE
Both Statements A and B are true Statement A is true and Statement B is false
IOException FileNotFoundException
statement 1:true statement2:true statement 1:false statement2:true
TRUE FALSE
DataInput ObjectInput
TRUE FALSE
File Writer
java/system /java/system
TRUE FALSE
TRUE FALSE
TRUE FALSE
FALSE TRUE
setting up BufferedOutputStreaman , an
application can write bytes to the underlying
BufferedOutputStream class is a member of
output stream without necessarily causing a
Java.io package
call to the underlying system for each byte
written.
Runnable Serializable
TRUE FALSE
ObjectInput StringReader
TRUE FALSE
TRUE FALSE
TRUE FALSE
1&2 1&2&3
10 11
switch continue
TRUE FALSE
by value by reference
switch for
10Bangalore 10
True False
10.98730.765 10.9873.765
A,Z a,z
break Jump
default break
executeUpdate() executeQuery()
ResultSet Parametrized
1&2 3&4
PreparedStatement ParameterizedStatement
Connection Connection
cn=DriverManager.getConnection("jdbc:odbc cn=DriverManager.getConnection("jdbc:odbc:
"); Mydsn", "username", "password");
TRUE FALSE
putConnection() setConnection()
TRUE FALSE
executeUpdate() executeQuery()
connection.sql db.sql
initialized started
java.util.Date java.sql.Date
TRUE FALSE
ResultSet Parametrized
DDL statements are treated as normal SQL
statements, and are executed by calling the To execute DDL statements, you have to
execute() method on a Statement (or a sub install additional support files
interface thereof) object
TRUE FALSE
putString() insertString()
Statement PreparedStatement
java.util.HashSet java.util.LinkedHashSet
ResultSet ResultSetMetaData
TRUE FALSE
Reader and Writer Stream APIs InputStream and OutputStream Stream APIs
TreeMap HashMap
Statement PreparedStatement
TRUE FALSE
Declare the ProgrammerAnalyst class has Declare the ProgrammerAnalyst class has
abstract private
finalization Serialization
java.lang.String java.lang.Double
Any one will be executed first lexographically Both of them will be executed simultaneously
FALSE TRUE
Generics provide type safety by shifting more Generics and parameterized types eliminate
type checking responsibilities to the the need for down casts when using Java
compiler. Collections.
Mark Employee class with abstract keyword Mark Employee class with final keyword
java.util.Map java.util.Set
2500 50
10 20 1 2 100 100 1 2 10 20 100 100
A compilation error will occur at (Line no 1), A compilation error will occur at (2), since
since constructors cannot specify a return the class does not have a default
value constructor
transient synchronized
Can't create object because constructor is
Compilation Error
private
System.out.println(Math.round(-4.7)); System.out.println(Math.min(-4.7));
transient default
B,D,E C,D,E
sum of int7 Compiles but error at runtime
class abstract Vehicle { abstract void abstract class Vehicle { abstract void
display(); } display(); { System.out.println("Car"); }}
p1 = (ClassB)p3; p1 = p2;
Hello B Compiles but error at runtime
Because of single inheritance, Animal can Because of single inheritance, Mammal can
have only one subclass have no siblings.
s 10 Compilation fails.
An overriding method can declare that it throws The parameter list of an overriding method
checked exceptions that are not thrown by the can be a subset of the parameter list of the
method it is overriding method that it is overriding
Compiles but error at run time 9
C D
Compilation error 47 47 47
abstract class AllMath implements DoMath,
class AllMath implements MathPlus
MathPlus { public double getArea(int rad)
{ double getArea(int rad); }
{ return rad * rad * 3.14; } }
C c2=(C)(B)c; A a1=(Test)c;
5, 4 Compilation fails
hello hellohello
3 4
java.util.List java.util.ArrayList
The program will compile and throw a runtime
The program will not compile
exception
14 123
2 -6 3 -4
int String
Java.util.Table Java.util.Collection
java.util.TreeSet java.util.Hashtable
[1,3,2,1,3,2] [3,1,2]
3 4
Compilation fails because of an error in line
An exception is thrown at runtime
21
[2,3,7,5,4,6] [2,3,4,5,6,7]
Compiles but error at run time Compiles but run without output
3 4
Compiles but error at run time Compiles but run without output
10, 0 11 , 0
Compiles but error at run time Compiles but run without output
13 Compilation Error
4 random value
a9 Compilation error
x = 4, y = 1, z = 5 x = 4, y = 2, z = 6
a: 9 b:9 a: 0 b:9
2 3
disp X = 5 main X=6 Compilation error
The access modifier must agree with the type It can be omitted, but if not omitted it must
of the return value be private or public
Dependency Composition
pkt = null rod = rat
Four objects and two reference variables Two objects and two reference variables.
Compilation error 82
24 11
result =
result+stringA+stringB+stringC; concat(StringA).concat(StringB).concat(Stri
ngC)
R I
result =
result+stringA+stringB+stringC; concat(StringA).concat(StringB).concat(Stri
ngC)
if(s.equalsIgnoreCase(s2)) if(s.noCaseMatch(s2))
The first line of output is abcd abc false The second line of output is abcd abc false
4 Compilation fails.
accircratna accrcratna
6 Compilation error
Cognizant Solutions Technology Solutions
Compilation error
The program will print str3,when run The program will print str3str1,when run
C D
234 246
255 Compiles but error at run time
25 Compilation Error
000120 00012021
Five Three
If a is false and b is false then the output is If a is false and b is true then the output is
"ELSE" "ELSE"
false 1
value = 2 value = 8
[608, 610, 612, 629] [608, 610] Compilation fails.
Vector LinkedList
b = nf.equals( input ); b = nf.parseObject( input );
4 1
5,5 6,6
s = s + s * i; s *= i;
headSet HeadSet
four one three two one two three four one
Compilation Error 10
4211 3211
compiler error runtime error
The code will compile correctly and display the The code will compile correctly and display
letter a,when run the letter b,when run
22 23
3 and 5 4 and 6
Virat Kohli M.S.Dhoni Sachin Virat Kohli
compilation error 40
2 23
3 11
An exception occurs at runtime. pi is bigger than 3. Have a nice day.
j=0 j=1
6,5 6,6
Integer, int int, Integer
_score.pack.__pack [email protected]@ckage.innerp@ckage
Packages can contain non-java elements such Sub packages should be declared as
as images, xml files etc. private in order to deny importing them
Object class has the core methods for thread Object class provides the method for Set
synchronization implementation in Collection framework
terminate() wait()
Interrupt class Object class
The output could be 6-1 5-2 6-2 5-1 The output could be 6-1 6-2 5-1 5-2
construct(); run();
CLASS RUNTIME
@include all the listed options
Depricated Documented
source runtime
Code output: Start Hello world File Not Found The code will not compile.
finally null
The notify() method is defined in class The notify() method causes a thread to
java.lang.Thread immediately release its locks.
NullPointerException ArrayIndexOutOfBoundsException
An exception is thrown at runtime. none
The program will throw an If run with one arguments,the program will
ArrayIndexOutOfBoundsException simply print the given argument
Implement java.lang.Thread and implement the Extend java.lang.Runnable and override the
start() method. start() method.
2, 4, 5 and 6 2, 3, 4 and 5
IllegalStateException IllegalArgumentException
join() start()
A thread will resume execution as soon as its The notify() method is overloaded to accept
sleep duration expires. a duration
Cannot determine output. Compilation Error
NoClassDefFoundError NumberFormatException
final private
hello throwit RuntimeException caught after hello throwit caught finally after
The program will print Hello world, then will The program will print Hello world, then will
print that a RuntimeException has occurred, print Finally executing, then will print that a
and then will print Finally executing. RuntimeException has occurred.
1, 2, 6 2, 3, 4
hello throwit RuntimeException caught after Compilation fails
The program will compile and print H|e|l|l|o|End The program will compile, print H|e|l|l|o|,
of stream. and then terminate normally.
I am a Person I am a Student I am a Student I am a Person
C,D A,B
write() writeDouble()
The file system has a directory named dir, The file system has a directory named
containing a file f1.txt newDir, containing a file f1.txt
writes data to the file in character form. Compiles but error at runtime
s.defaultWriteObject(); s.writeObject(x);
PreparedStatement RowSet
execute() executeQuery()
Both A and C is TRUE All are TRUE
Compiles but error at run time Compiles but run without output
DatabaseMetaData.getMaxConnections ResultSetMetaData.getMaxConnections
execute() executeQuery()
registerDriver() method and Class.forName() getConnection
public,friend final,protected
Constructor Destructor
All members of abstract class are by default Protected is default access modifier of a
protected child class
2&3 1&2&4
Child Parent Child
2&3 3&4
static abstract
WD 500 Compile Error.
20 10 10 20
public void bM2(){} All of the listed options
public void aM1(){} public void aM2(){} public
public void aM1(){} public void bM2(){}
void bM1(){} public void bM2(){}
This class must also implement the hashCode The code will compile as Object class's
method as well. equals method is overridden.
System.out.gc(); System.gc();
line 5 line 1
Statement A is false and Statement B is true Both Statements A and B are false
Option 1 Option 4
4 2
finally access
4 Compilation error
13,13,0 12,13,-1
throwed Integer
print main
I->III->IV->II I->II->III->IV
The code executes normally, but nothing is
Compilation fails.
printed.
The delay between “Start!” being printed and If “Time’s Over!” is printed, you can be sure
“Time’s Over!” will be 10 seconds plus or minus that at least 10 seconds have elapsed since
one tick of the system clock. “Start!” was printed.
Dead Blocked
2&3 1&4
Three Four
notifyAll() all the options
2&3 1&4
SortedList SortedQueue
Creates a Date object with current date and Creates a Date object with current date
time as default value alone as default value
The ListIterator interface provides the ability to The ListIterator interface provides forward
determine its position in the List. and backward iteration capabilities.
Object set1
java.util.Dictionary java.util.HashMap
SortedSet Comparable
All implementations are serializable and all implementations are immutable and
cloneable supports duplicates data
foreach Iterator
Statement A is false and Statement B is true Both the statements A and B are false.
C D
2&3 1&4
Statement A is false and Statement B is true Both Statements A and B are false
compareTo compareWith
compilation error Runtime error
x = Rules x = Java
Strings cannot be compare using ==
compilation error
operator
x = Java x="JAVA"
1&3 2
1&3&4 1&2&4
throws Exception No code is necessary.
Demands a finally block at line number 4 Demands a finally block at line number 5
NoClassDefFoundError is a subClass of
None of the options
ClassNotFoundException
throw RuntimeException
2&3 1&4
Both catch block and finally block can throw
All of the listed options
exceptions
compilation error
hello Math problem occur string problem occur
hello string problem occur stopped
problem occurs stopped
throw throwable
RunTimeException FileNotFindException
thrown catch
Compile time error Cannot use Throwable to Run time error test() method does not throw
catch the exception a Throwable instance
Statement A is false and Statement B is true Both Statements A and B are false
SQLException NullPointerException
statement 1:false statement2:false statement 1:true statement2:false
ObjectFilter FileFilter
Reader OutputStream
1&3&4 1&2&4
break label
4 8
while do …. While
6,0 0,5
91,97 97,91
exit goto
continue new
execute() noexecute()
PreparedStatement Condition
2&3 1&4
Connection Connection
cn=DriverManager.getConnection("jdbc:odbc cn=DriverManager.getConnection("jdbc:odb
","username", "password"); c:dsn" ,"username", "password");
Connection() getConnetion()
execute() noexecute()
pkg.sql java.sql
paused stopped
java.sql.Time java.sql.Timestamp
TableStatement Condition
DDL statements cannot be executed by
Support for DDL statements will be a
making use of JDBC, you should use the
feature of a future release of JDBC
native database tools for this.
Statement A is False and Statement B is True. Both Statements A and B are False.
setString() setToString()
java.util.List java.util.ArrayList
DataSource Statement
Reduces effort to learn and to use new APIs Fosters software reuse
Declare the ProgrammerAnalyst class has final None of the listed options
Synchronization Deserialization
java.lang.StringBuffer java.lang.Character
Make Employee class methods private Make Employee class methods public
java.util.List java.util.Collection
0 0 0 1
0 0 0 1
0 1 0 0
0 0 1 0
0 0 0 1
0 0 1 0
0 1 0 0
0 0 1 0
0 0 0 1
0 1 0 0
1 0 0 0
0 0 0 1
1 0 0 0
0 0 0.5 0.5
1 0 0 0
0 0 1 0
1 0 0 0
0 1 0 0
0 0 1 0
0 1 0 0
1 0 0 0
0 0 1 0
0 0 0 1
1 0 0 0
1 0 0 0
1 0 0 0
0 1 0 0
0 1 0 0
1 0 0 0
1 0 0 0
0 0 1 0
1 0 0 0
0 1 0 0
0 0 1 0
0 0 1 0
1 0 0 0
0 0 0 1
1 0 0 0
0 0 1 0
0 0 0 1
1 0 0 0
0 0 0 1
0 1 0 0
1 0 0 0
1 0 0 0
0 0 0 1
0 0 1 0
0 1 0 0
0 1
1 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
0 0 0 1
0 0 1 0
0 1 0 0
0 1 0 0
0 1 0 0
0 1 0 0
0 0 1 0
0 1 0 0
0 0 1 0
1 0 0 0
0.5 0 0.5 0
0 0 0 1
0 1 0 0
0 0 0 1
0 1 0 0
0.5 0.5 0 0
0 0 1 0
0 0 1 0
0 0 0 1
0 0 0 1
0 1 0 0
Calling super() as the first
statement in the body of a
constructor of a subclass will
0 1 0 0 0
always work, since all
superclasses have a default
constructor.
1 0 0 0
0 1 0 0
0 0 0 1
0 1 0 0
0 0 0 1
0 1 0 0
1 0 0 0
1 0 0 0
0 0 1 0
0 0 0 1
0 0 1 0
0 0 0 1
0 0 1 0
0 1 0 0
0 0 0 1
0 0 1 0
1 0 0 0
0 0 1 0
0 0 1 0
0 0 1 0
0 0 0 1
0 1 0 0
0 1 0 0
0 0 1 0
java.util.Vector 0 0 0 1 0
0 0 1 0
0 0 0 1
0 0 1 0
0 1 0 0
0 0 1 0
1 0 0 0
0 1 0 0
0 0 0 1
0 0 1 0
0 1 0 0
0 1 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 0 1 0
0 0 1 0
0 0 1 0
1 0 0 0
0 0 1 0
0 0 1 0
0 0 0 1
[3,1,1,2] 1 0 0 0 0
0 1 0 0
0 0 0 1
Compilation fails because of an
1 0 0 0 0
error in line 23.
0 0 1 0
0 1 0 0
0 0 1 0
0 0 1 0
1 0 0 0
0 0 0 1
0 0 1 0
1 0 0 0
0 1 0 0
0 0 1 0
1 0 0 0
0 0 1 0
Compilation error 0 0 0 1 0
1 0 0 0
0 0 0 1
1 0 0 0
0 1 0 0
0 1 0 0
0 0 0 1
0 0 0 1
0 0 1 0
0 0 0 1
0 1 0 0
Dog myDogs [7]; 0.333 0.333 0 0.333 0
Runtime Error 0 0 0 1 0
1 0 0 0
0 1 0 0
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 0 1 0
0 1 0 0
1 0 0 0
0 0 0.5 0.5
Line 4 0 1 0 0 0
1 0 0 0
0 1 0 0
1 0 0 0
1 0 0 0
0 1 0 0
0 0 0 1
0 0 0 1
0 1 0 0
A.this.doIt() 1 0 0 0 0
0 0 1 0
0 1 0 0
1 0 0 0
0 0 0 1
0 1 0 0
0 1 0 0
1 0 0 0
1 0 0 0
1 0 0 0
0 0 1 0
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
0 0 1 0
if(s.equalIgnoreCase(s2)) 0 0 1 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 0 0 1
0 0 0 1
0 1 0 0
0 0 1 0
1 0 0 0
0 0 1 0
1 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
0 0 1 0
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 0 0 1
0 0 0 1
Runtine Error 0 0 1 0 0
0 0 1 0
0 0 1 0
1 0 0 0
0 0 0 1
0 0 1 0
0 1 0 0
0 0 1 0
0 0 0 1
0 1 0 0
0 0 0 1
1 0 0 0
0 1 0 0
0 0 1 0
0 0 1 0
ArrayList 0 0 0 1 0
0 1 0 0
0 0 0 1
1 0 0 0
0.5 0 0 0.5
0 0 1 0
0 0 1 0
0 0 0 1
0 0 1 0
Compilation error 0 0 0 1 0
1 0 0 0
0 0 1 0
0 1 0 0
0 0 0 1
0 1 0 0
0 0 1 0
0 0 1 0
Runtime Error 0 0 1 0 0
short 0 0 0 1 0
0 1 0 0
0 0 1 0
0 0 0 1
0 0 1 0
0 0 0.5 0.5
0 1 0 0
0 1 0 0
1 0 0 0
0 0 1 0
0 0 0 1
0 0 0 1
0 0 1 0
0 0 0 1
7 0 0 0 1 0
1 0 0 0
1 0 0 0
0 0 1 0
0 1 0 0
0 1 0 0
.
package.subpackage.innerpack 0.333 0.333 0.333 0 0
age
0 1 0 0
0 0 1 0
0 1 0 0
0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
0 0 0 1
1 0 0 0
0 0 0 1
1 0 0 0
0 1 0 0
0 0 0 1
0 0 1 0
0 0 1 0
1 0 0 0
0 0 1 0
1 0 0 0
0 1 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 1 0 0
1 0 0 0
0 0 1 0
0 0 1 0
1 0
0 1 0 0
1 0 0 0
0 1 0 0
1 0 0 0
0 1 0 0
0 1 0 0
0 0 1 0
0 1 0 0
A finally block must always
0 0 0 1 0
follow one or more catch blocks
0 1 0 0
0 1 0 0
0 0 1 0
Implement java.lang.Thread
and implement the run() 0.5 0.5 0 0 0
method.
1 0 0 0
0 0.5 0 0.5
0 0.5 0 0.5
0.5 0.5 0 0
1 0 0 0
peep 0 0 0 1 0
0 0 0 1
0 0 0 1
0 0 0 1
0 0 0 1
0 1 0 0
0 0 0 1
0 0 1 0
0 0 1 0
0 0 1 0
0 0 0 1
1 0
0 0 1 0
0 1 0 0
The program will only print
0 0 0 1 0
1,2,4 and 5 in order
0 0 0 1
0 0 1 0
1 0 0 0
1 0 0 0
0 0 1 0
1 0 0 0
0 0 0 1
Compilation fails with an error
0 0 0 0.5 0.5
on line 9
0 0 1 0
0 0 0 1
0 1 0 0
1 0 0 0
0 0 0 1
0 1 0 0
1 0 0 0
1 0 0 0
0 0 0 1
0 0 1 0
0 0 1 0
0 1 0 0
1 0 0 0
0 0 0 1
0 1 0 0
Compilation error 0 0 0 1 0
1 0 0 0
0 0 0 1
0 0 1 0
1 0 0 0
Compilation Error 0 0 0 0 1
1 0 0 0
0 0 1 0
1 0 0 0
0 0 0 1
PreparedStatement Interface 1 0 0 0 0
0 0 1 0
0 0 1 0
1 0
0 0 0 1
0 0 1 0
0 1 0 0
0 0 1 0
0 0.5 0.5 0
1 0
1 0 0 0
0 0 1 0
1 0 0 0
0 0 1 0
0 0 0 1
0 0 1 0
0 0 1 0
executeUpdate() 0 0 1 0 0
1 0
0 0 1 0
Class 0 0 0 1 0
private,abstract 0 1 0 0 0
0 1 0 0
0 0 1 0
0 1
1 0
Variable 0 0 1 0 0
0 1 0 0
1 0 0 0
1 0 0 0
1 0
1 0 0 0
1 0 0 0
1 0 0 0
1 0
1 0
2&4 0 0 0 1 0
0 0 1 0
2&4 0 0 0 0 1
1 0
0 1
1 0 0 0
0 0 1 0
1 0
0 1 0 0
1 0
0 1
1 0
0 1
1 0
0 1
0 1
0 0 0 1
0 0 1 0
0 0 1 0
1 0 0 0
1 0
1 0 0 0
0 1 0 0
0 0 0 1
1 0 0 0
1 0 0 0
1 0 0 0
1 0
1 0 0 0
0 1 0 0
1 0 0 0
1 0 0 0
2&4 0 0 0 0 1
0 0 0 1
1 0 0 0
0 1 0 0
1 0 0 0
0 0 1 0
0 1 0 0
0 0 1 0
0 0 0 1
1 0
0 1
0 1 0 0
1 0
0 1 0 0
Boolean 0 0 1 0 0
Object 0 1 0 0 0
1 0 0 0
1 0 0 0
1 0
No Output 0 0 0 0 1
0 1 0 0
0 0 1 0
0 1 0 0
1 0
0 0 0 1
0 0 0 1
Stop 0 0 0 0 1
2&4 0 0 0 1 0
0 0 1 0
0 1 0 0
0 0 0 1
0 1 0 0
2&4 0 0 0 0 1
0.5 0.5 0 0
0 1
0 0 1 0
0 1
1 0
0 0 1 0
0 0 1 0
0 0 1 0
1 0
1 0
0.5 0 0 0.5
0 1
1 0
0 0 0.5 0.5
0 0 0.5 0.5
0 0 0.5 0.5
1 0
0 0.5 0 0.5
0 1
0 0 0.5 0.5
0 0 0 1
E 0 0 0 1 0
0 1
0 1
0 1
0 0 0
1 0
2&4 0 1 0 0 0
0 1 0 0
0 0 1 0
1 0
0 1
1 0
1 0 0 0
1 0
1 0
0 1 0 0
0 1 0 0
0 1
1 0 0 0
1 0
0 1 0 0
0 1
0 1
0 0 0 1
0 0 0 1
0 1 0 0
0 1 0 0
0 0 1 0
2&3 1 0 0 0 0
1 0 0 0
0 1 0 0
0 1
2&4 0 0 1 0 0
0 1
1 0
1 0
0 0 1 0
0 0 0 1
0.5 0.5 0 0
0 1
1 0 0 0
2&4 1 0 0 0 0
0 0 0 1
1 0
0 0 1 0
0 0 1
0 0 0 1
0 0 1 0
0 1 0 0
0.5 0 0 0.5
1 0 0 0
0 0 0 1
0.5 0.5 0 0
1 0
1 0
2&4 0 0 0 0 1
0 0 0.5 0.5
1 0
0.5 0 0.5 0
1 0 0 0
1 0 0 0
0 0 0 1
0 1 0 0
1 0
0 0 1 0
1 0
0 0 1 0
0 1
1 0
1 0
1 0
0 1 0 0
1 0
0 0.5 0.5 0
0 1
0 1
1 0
2&4 0 0 1 0 0
0 1 0 0
branch 1 0 0 0 0
0 1 0 0
1 0 0 0
1 0
64 0 0 0 1 0
1 0 0 0
for..each 0 0 0 1 0
0 0 0 1
1 0 0 0
0 1 0 0
1 0 0 0
0 1 0 0
0 0 0 1
escape 1 0 0 0 0
none 0 1 0 0 0
0 1 0 0
0 0 1 0
2&4 0 0 1 0 0
1 0 0 0
0 1 0 0
0 1
0 0 0 1
0 0 0 1
0 1 0 0
0 1 0 0
1 0
0 0 1 0
0 0 0 1
1 0 0 0
0 0 0 1
1 0
1 0 0 0
1 0 0 0
1 0 0 0
1 0
1 0 0 0
1 0 0 0
0 0 1 0
0 0 1 0
0 1 0 0
0 0 0 1
0 1 0 0
1 0
1 0 0 0
1 0 0 0
0 0 1 0
1 0
0 0.5 0 0.5
0 0 1 0
0 1 0 0
0 0 0 1
1 0 0 0
0 0 1 0
1 0 0 0
0 0 1 0
0 0 0 1
1 0
0 0 1 0
1 0 0 0
0 1 0 0
0 1 0 0