68501. Indian National Congress was founded on the year--------
68502. Name the secret society organized by V.Savarkar
68503. Which three statements are true? Assertion checking is typically enabled when a program is deployed. It is never appropriate to write code to handle failure of an assert statement. Assertion checking is typically enabled during program development and testing. Assertion checking can be selectively enabled or disabled on a per-package basis, but not on a per-class basis. Assertion checking can be selectively enabled or disabled on both a per-package basis and a per-class basis.
68504. public class Test2 { public static int x; public static int foo(int y) { return y 2; } public static void main(String [] args) { int z = 5; assert z > 0; / Line 11 / assert z > 2: foo(z); / Line 12 / if ( z < 7 ) assert z > 4; / Line 14 / switch (z) { case 4: System.out.println("4 "); case 5: System.out.println("5 "); default: assert z < 10; } if ( z < 10 ) assert z > 4: z++; / Line 22 / System.out.println(z); } } which line is an example of an inappropriate use of assertions?
68505. public class Test { public void foo() { assert false; / Line 5 / assert false; / Line 6 / } public void bar() { while(true) { assert false; / Line 12 / } assert false; / Line 14 / } } What causes compilation to fail?
68506. What will be the output of the program? public class Test { public static void main(String[] args) { int x = 0; assert (x > 0) ? "assertion failed" : "assertion passed" ; System.out.println("finished"); } }
68507. Who among the following started the publication of Swadeshabimani newspaper with Sri.Ramakrishna Pillai as its editor?
68508. What will be the output of the program? public class Test { public static int y; public static void foo(int x) { System.out.print("foo "); y = x; } public static int bar(int z) { System.out.print("bar "); return y = z; } public static void main(String [] args ) { int t = 0; assert t > 0 : bar(7); assert t > 1 : foo(8); / Line 18 / System.out.println("done "); } }
68509. What will be the output of the program (when you run with the -ea option) ? public class Test { public static void main(String[] args) { int x = 0; assert (x > 0) : "assertion failed"; / Line 6 / System.out.println("finished"); } }
68510. Name the organization founded by Sri.K.P.Karuppan for the upliftment of the lower caste people in Kerala
68511. Who shared the Nobel Peace Prize with Malala Yousafzai in 2014?
68512. Which of the following nations have joined together for an active role in the rapidly evolving international order by the name”G5 Nations”?
68513. To which Ministry,Nirmala Sitaram is associated currently?
68514. How many teams had participated in the 2015 World Cup Cricket?
68515. To which non-governmental organization,the Government of India has blocked funding,as it was affecting the public and economic interests of the country?
68516. What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package?
68517. Which of the following is/are legal method declarations? protected abstract void m1(); static final void m1(){} synchronized public final void m1() {} private native void m1();
68518. Which cause a compiler error?
68519. Which three are valid method signatures in an interface? private int getArea(); public float getVol(float x); public void main(String [] args); public static void main(String [] args); boolean setFlag(Boolean [] test);
68520. You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective?
68521. What is the widest valid returnType for methodA in line 3? public class ReturnIt { returnType methodA(byte x, double y) / Line 3 / { return (long)x / y 2; } }
68522. class A { protected int method1(int a, int b) { return 0; } } Which is valid in a class that extends class A?
68523. Which one creates an instance of an array?
68524. Which two of the following are legal declarations for nonnested classes and interfaces? final abstract class Test {} public static interface Test {} final public class Test {} protected abstract class Test {} protected interface Test {} abstract public class Test {}
68525. Which of the following class level (nonlocal) variable declarations will not compile?
68526. Which two cause a compiler error? float[ ] f = new float(3); float f2[ ] = new float[ ]; float[ ]f1 = new float[3]; float f3[ ] = new float[3]; float f5[ ] = {1.0f, 2.0f, 2.0f};
68527. Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?
68528. Which is a valid declaration within an interface?
68529. What will be the output of the program? class A { final public int GetResult(int a, int b) { return 0; } } class B extends A { public int GetResult(int a, int b) {return 1; } } public class Test { public static void main(String args[]) { B b = new B(); System.out.println("x = " + b.GetResult(0, 1)); } }
68530. What will be the output of the program? public class Test { public static void main(String args[]) { class Foo { public int i = 3; } Object o = (Object)new Foo(); Foo foo = (Foo)o; System.out.println("i = " + foo.i); } }
68531. What will be the output of the program? public class A { void A() / Line 3 / { System.out.println("Class A"); } public static void main(String[] args) { new A(); } }
68532. What will be the output of the program? class Super { public int i = 0; public Super(String text) / Line 4 / { i = 1; } } class Sub extends Super { public Sub(String text) { i = 2; } public static void main(String args[]) { Sub sub = new Sub("Hello"); System.out.println(sub.i); } }
68533. What will be the output of the program? public class Test { public int aMethod() { static int i = 0; i++; return i; } public static void main(String args[]) { Test test = new Test(); test.aMethod(); int j = test.aMethod(); System.out.println(j); } }
68534. What will be the output of the program? interface Count { short counter = 0; void countUp(); } public class TestCount implements Count { public static void main(String [] args) { TestCount t = new TestCount(); t.countUp(); } public void countUp() { for (int x = 6; x>counter; x--, ++counter) / Line 14 / { System.out.print(" " + counter); } } }
68535. What will be the output of the program? class Base { Base() { System.out.print("Base"); } } public class Alpha extends Base { public static void main(String[] args) { new Alpha(); / Line 12 / new Base(); / Line 13 / } }
68536. What will be the output of the program? import java.util.; public class NewTreeSet2 extends NewTreeSet { public static void main(String [] args) { NewTreeSet2 t = new NewTreeSet2(); t.count(); } } protected class NewTreeSet { void count() { for (int x = 0; x < 7; x++,x++ ) { System.out.print(" " + x); } } }
68537. What will be the output of the program? public class ArrayTest { public static void main(String[ ] args) { float f1[ ], f2[ ]; f1 = new float[10]; f2 = f1; System.out.println("f2[0] = " + f2[0]); } }
68538. What will be the output of the program? class Super { public Integer getLength() { return new Integer(4); } } public class Sub extends Super { public Long getLength() { return new Long(5); } public static void main(String[] args) { Super sooper = new Super(); Sub sub = new Sub(); System.out.println( sooper.getLength().toString() + "," + sub.getLength().toString() ); } }
68539. interface DoMath { double getArea(int rad); } interface MathPlus { double getVol(int b, int h); } / Missing Statements ? / which two code fragments inserted at end of the program, will allow to compile? class AllMath extends DoMath { double getArea(int r); } interface AllMath implements MathPlus { double getVol(int x, int y); } interface AllMath extends DoMath { float getAvg(int h, int l); } class AllMath implements MathPlus { double getArea(int rad); } abstract class AllMath implements DoMath, MathPlus { public double getArea(int rad) { return rad rad 3.14; } }
68540. Which two statements are true for any concrete class implementing the java.lang.Runnable interface? You can extend the Runnable interface as long as you override the public run() method. The class must contain a method called run() from which all code for that thread will be initiated. The class must contain an empty public void method named run(). The class must contain a public void method named runnable(). The class definition must include the words implements Threads and contain a method called run(). The mandatory method must be public, with a return type of void, must be called run(), and cannot take any arguments.
68541. / Missing statements ? / public class NewTreeSet extends java.util.TreeSet { public static void main(String [] args) { java.util.TreeSet t = new java.util.TreeSet(); t.clear(); } public void clear() { TreeMap m = new TreeMap(); m.clear(); } } which two statements, added independently at beginning of the program, allow the code to compile? No statement is required import java.util.; import.java.util.Tree; import java.util.TreeSet; import java.util.TreeMap;
68542. Which three statements are true? The default constructor initialises method variables. The default constructor has the same access as its class. The default constructor invokes the no-arg constructor of the superclass. If a class lacks a no-arg constructor, the compiler always creates a default constructor. The compiler creates a default constructor only when there are no other constructors for the class.
68543. package testpkg.p1; public class ParentUtil { public int x = 420; protected int doStuff() { return x; } } package testpkg.p2; import testpkg.p1.ParentUtil; public class ChildUtil extends ParentUtil { public static void main(String [] args) { new ChildUtil().callStuff(); } void callStuff() { System.out.print("this " + this.doStuff() ); / Line 18 / ParentUtil p = new ParentUtil(); System.out.print(" parent " + p.doStuff() ); / Line 20 / } } which statement is true?
68544. You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?
68545. public class Outer { public void someOuterMethod() { //Line 5 } public class Inner { } public static void main(String[] argv) { Outer ot = new Outer(); //Line 10 } } Which of the following code fragments inserted, will allow to compile?
68546. interface Base { boolean m1 (); byte m2(short s); } which two code fragments will compile? interface Base2 implements Base {} abstract class Class2 extends Base
{ public boolean m1(){ return true; }} abstract class Class2 implements Base {} abstract class Class2 implements Base
{ public boolean m1(){ return (7 > 4); }} abstract class Class2 implements Base
{ protected boolean m1(){ return (5 > 7) }}
68547. Which three form part of correct array declarations? public int a [ ] static int [ ] a public [ ] int a private int a [3] private int [3] a [ ] public final int [ ] a
68548. public class Test { } What is the prototype of the default constructor?
68549. Who propounded the theory of “Economic Drain of India”?