A class member declared protected becomes member of subclass of which type?
What is the output of this program?
1.class Output {
2.public static void main(String args[]) {
3.Integer i = new Integer(257);
4.byte x = i.byteValue();
5.System.out.print(x);
6.}
7.}
What is the output of this program?
1.class Output {
2.public static void main(String args[])
3.{
4.final int a=10,b=20;
5.while(a
What is the value of “d” after this line of code has been executed?
double d = Math.round ( 2.5 + Math.random() );
Which of these class relies upon its subclasses for complete implementation of its methods?
Standard output variable ‘out’ is defined in which class?
Which of these can be returned by the operator & ?
What is the output of this program?
1.import java.util.*;
2.class Linkedlist {
3.public static void main(String args[]) {
4.LinkedList obj = new LinkedList();
5.obj.add("A");
6.obj.add("B");
7.obj.add("C");
8.obj.removeFirst();
9.System.out.println(obj);
10.}
11. }
Which of these operators can be used to concatenate two or more String objects?
Which of these selection statements test only for equality?
Which of these class holds a collection of static methods and variables?
What is the output of this program? 1.class increment {
2.public static void main(String args[])
3.{
4.int g = 3;
5.System.out.print(++g * 8);
6.}
7.}
Which of the following is incorrect statement about packages?
What is the output of this program?
1.class output {
2.public static void main(String args[])
3.{
4.String s1 = "Hello i love java";
5.String s2 = new String(s1);
6. System.out.println((s1 == s2) + " " + s1.equals(s2));
7.}
8.}
What is the output of this program?
1.class output {
2.public static void main(String args[])
3.{
4.String s1 = "Hello i love java";
5.String s2 = new String(s1);
6. System.out.println((s1 == s2) + " " + s1.equals(s2));
7.}
8.}
Which of these method of DatagramPacket is used to find the length of byte array?
What is the output of this program?
1.class output {
2.public static void main(String args[])
3.{
4.String s1 = "one";
5.String s2 = s1 + " two";
6.System.out.println(s2);
7.}
8.}
Which of these class object has architecture similar to that of array?
Which of the following is correct way of implementing an interface salary by class manager?
What is the output of this program?
1.class Abc
2.{
3.public static void .main(String[]args)
4.{
5.String[] elements = { "for", "tea", "too" };
6.String first = (elements.length > 0) ? elements[0]: null;
7.}
8.}
What is the output of this program?
1.import java.util.*;
2.class Output {
3.public static void main(String args[]) {
4.ArrayList obj = new ArrayList();
5.obj.add("A");
6.obj.add(0, "B");
7.System.out.println(obj.size());
8.}
9.}
Which of the following is a valid declaration of an object of class Box?
Which of these method is used to add an element to the start of a LinkedList object?
What is the output of this program?
1.import java.util.*;
2.class Maps {
3..public static void main(String args[]) { 4.HashMap obj = new HashMap();
5.obj.put("A", new Integer(1));
6.obj.put("B", new Integer(2));
7.obj.put("C", new Integer(3));
8.System.out.println(obj);
9.}
10.}
What is the output of this program?
1.class c {
2.public void main( String[] args )
3.{
4.System.out.println( "Hello" + args[0] );
5.}
6.}
What is the output of this program, if we run as “java main_arguments 1 2 3”? 1.class main_arguments {
2.public static void main(String [] args)
3. {
4.String [][] argument = new String[2][2];
5.int x;
6.argument[0] = args;
7.x = argument[0].length;
8.for (int y = 0; y < x; y++)
9.System.out.print(" " + argument[0][y]);
10.}
11.}
Which operator is used by Java run time implementations to free the memory of an object when it is no longer needed?
Which of these keywords is used to define interfaces in Java?
Which of the following method of Process class can terminate a process?
Which of these class can encapsulate an entire executing program?
Which of these method is used to remove all keys/values pair from the invoking map?
Which of this access specifies can be used for a class so that its members can be accessed by a different class in the same package?
What is the output of this program?
1.class A {
2.int i;
3.int j;
4.A() {
5.i = 1;
6.j = 2;
7.}
8.}
9.class Output {
10.public static void main(String args[])
11.{
12.A obj1 = new A();
13.System.out.print(obj1.toString());
14.}
15.}
What is the output of this program?
1.class Modulus {
2. public static void main(String args[])
3.{
4.double a = 25.64;
5.int b = 25;
6.a = a % 10;
7.b = b % 10;
8.System.out.println(a + " " + b);
9.}
10.}
What is the value returned by unction compareTo() if the invoking string is less than the string compared?
Which of these statement is incorrect?
Which operator is used by Java run time implementations to free the memory of an object when it is no longer needed?
What is the output of this program?
1.import java.io.*;
2.class files {
3.public static void main(String args[]) {
4.File obj = new File("/java/system");
5.System.out.print(obj.getName());
6.}
7.}
What is the name of data member of class Vector which is used to store number of elements in the vector?
What is the output of this program?
1.class A {
2.public int i;
3.private int j;
4.}
5.class B extends A {
6.void display() {
7.super.j = super.i + 1;
8.System.out.println(super.i + " " + super.j);
9.}
10.}
11.class inheritance {
12.public static void main(String args[])
13.{
14.B obj = new B();
15.obj.i=1;
16.obj.j=2;
17.obj.display();
18.}
19.}