What is the output of this program?
1.class ternary_operator {
2.public static void .main(String args[])
3.{
4.int x = 3;
5.int y = ~ x;
6.int z;
7.z = x > y ? x : y;
8.System.out.print(z);
9.}
10.}
Which of the following statement is correct?
What is the output of this program?
1.class Output {
2.public static void.main(String args[])
3.{
4.int a = 5;
5.int b = 10;
6.first: {
7.second: {
8.third: {
9.if (a == b >> 1)
10.break second;
11.}
12.System.out.println(a);
13.}
14.System.out.println(b);
15.}
16.}
17.}
Which of these operators can skip evaluating right hand operand?
Which of these is used as default for a member of a class if no access specifier is used for it?
Which of these keywords can be used to prevent Method overriding?
Which of these coding types is used for data type characters in Java?
What is the output of this program? 1.class area {
2.public static void main(String args[])
3.{
4.double r, pi, a;
5.r = 9.8;
6.pi = 3.14;
7.a = pi * r * r;
8.System.out.println(a);
9.}
10.}
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.}
Which of these methods is used to compare a specific region inside a string with another specific region in another string?
Which of these method is used to change an element in a LinkedList Object
What is the output of this program?
1.class Output {
2.public static void main(String args[]) {
3.Integer i = new Integer(257);
4.float x = i.floatValue();
5.System.out.print(x);
6.}
7.}
What is the output of this program?
1.import java.util.*;
2.class vector {
3.public static void main(String args[]) {
4.Vector obj = new Vector(4,2); 5.obj.addElement(new Integer(3));
6.obj.addElement(new Integer(2));
7.obj.addElement(new Integer(6));
8.obj.insertElementAt(new Integer(8), 2);
9.System.out.println(obj);
10.}
11.}
-
-
-
-
What is the output of this program?
1.class leftshift_operator {
2.public static void main(String args[])
3.{
4.byte x = 64;
5.int i;
6. byte y;
7.i = x << 2;
8.y = (byte) (x << 2)
9.System.out.print(i + " " + y);
10.}
11.}
What is the output of this program?
1.class A {
2.public int i;
3.protected int j;
4.}
5.class B extends A {
6.int j;
7.void display() {
8.super.j = 3;
9.System.out.println(i + " " + j);
10.}
11.}
12.class Output {
13.public static void main(String args[])
14.{
15. B obj = new B();
16.obj.i=1;
17.obj.j=2;
18.obj.display();
19.}
20.}
Which of these is an on correct statement?
What is the output of this program?
1.class Output {
2.public static void main(String args[]) {
3.Long i = new Long(256);
4.System.out.print(i.hashCode());
5.}
6.}
Which of these keywords is used to make a class?
Which of these method of DatagramPacket class is used to find the destination address?
What is the output of this program?
1.class Alligator
2.{
3.public static void main(String[] args)
4.{
5.int []x[] = {{1,2}, {3,4,5}, {6,7,8,9}};
6.int [][]y = x;
7.System.out.println(y[2][1]);
8.}
9.}
Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
What does URL stands for?
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.A obj2 = new A();
14.System.out.print(obj1.equals(obj2));
15.}
16.}
Which of these method of Object class can clone an object?
Which of the following is a method having same name as that of its class?
What is the output of this program?
1.import java.util.*;
2.class Bitset {
3.public static void main(String args[]) {
4.BitSet obj = new BitSet(5);
5.for (int i = 0; i < 5; ++i)
6.obj.set(i);
7.obj.clear(2);
8.System.out.print(obj.length() + " " + obj.size());
9.}
10.}
What is the output of this program?
1.class isNaN_output {
2.public static void main(String args[]) {
3.Double d = new Double(1 / 0.);
4.boolean x = d.isNaN();
5.System.out.print(x);
6.}
7.}
Which of the following are legal lines of Java code? 1. int w = (int)888.8; 2.byte x = (byte)100L; 3.long y = (byte)100; 4.byte z = (byte)100L;
Which of these is method for testing whether the specified element is a file or a directory?
Which of these method of class StringBuffer is used to concatenate the string representation to the end of invoking string?
Which of the following is correct way of implementing an interface salary by class manager?
A class member declared protected becomes member of subclass of which type?
What is the process of defining a method in subclass having same name & type signature as a method in its superclass?
Which of these methods must be made static?
Which of these class object uses key to store value?
What is the output of this program?
1.class char_increment {
2.public static void main(String args[])
3.{
4.char c1 = 'D';
5.char c2 = 84;
6.c2++;
7.c1++;
8.System.out.println(c1 + " " + c2);
9.}
10.}
What is the output of this program? 1.class A {
2.int i;
3.}
4.class B extends A {
5.int j;
6.void display() {
7.super.i = j + 1;
8.System.out.println(j + " " + i);
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.}
Which of these is returned by “greater than”, “less than” and “equal to” operators
What is the output of this program?
1.class String_demo {
2.public static void main(String args[])
3.{
4.char chars[] = {'a', 'b', 'c'};
5.String s = new .String(chars);
6.String s1 = "abcd";
7.int len1 = s1.length();
8.int len2 = s.length();
9.System.out.println(len1 + " " + len2);
10.}
11.}
What is the output of this program?
1.class area {
2.int width;
3.int length;
4.int volume;
5.area() {
6.width=5;
7.length=6;
8.}
9.void volume() {
1o.volumewidth*length*height;
11.}
12.}
13.class cons_method {
14.public static void main(String args[])
15.{
16.area obj = new area();
17.obj.volume();
18.System.out.println(obj.volume);
19.}
20}