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.}
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 data type value is returned by equals() method of String class?
Which of these packages contain classes and interfaces used for input & output operations of a program?
What is the output of this program?
1.class selection_statements {
2. public static void main(String args[])
3.{
4.int var1 = 5;
5.int var2 = 6;
6.if ((var2 = 1) == var1)
7.System.out.print(var2);
8.else
9.System.out.print(++var2);
10.}
11.}
Which of the following method of Process class can terminate a process?
What is the output of this program?
1.class Output {
2.public static void main(String args[]) {
3.byte a[] = { 65, 66, 67, 68, 69, 70 };
4.byte b[] = { 71, 72, 73, 74, 75, 76 };
5.System.arraycopy(a, 2, b, 1, a.length-2); 6.System.out.print(new String(a) + " " + new String(b));
7.}
8.}
Which of these keywords can be used to prevent inheritance of a class?
Which of these class object can be used to form a dynamic array?
What is the output of this program? 1.class mainclass {
2.public static void main(String args[])
3.{
4.boolean var1 = true;
5.boolean var2 = false;
6.if (var1)
7.System.out.println(var1);
8.else
9.System.out.println(var2);
10.}
11.}
Which of these constructors is used to create an empty String object?
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.System.out.println(s);
7.}
8. }
What is the output of this program?
1.class Output {
2.public static void main(String args[])
3.{
4.int x , y = 1;
5.x = 10;
6.if (x != 10 && x / 0 == 0)
7.System.out.println(y);
8.else
9.System.out.println(++y);
10.}
11.}
What is the output of this program?
1.package pkg;
2.class output {
3.public static void main(String args[])
4.{
5.StringBuffer s1 = new StringBuffer("Hello World");
6.s1.insert(6 , "Good ");
7.System.out.println(s1);
8.}
9.}
Which of these methods is used to make raw MIME formatted string?
Which of these method of class StringBuffer is used to extract a substring from a String object?
Which of these methods must be made static?
What is the output of this program?
1.class string_class {
2.public static void main(String args[])
3.{
4.String obj = "I LIKE JAVA";
5.System.out.println(obj.length());
6.}
7.}
Which of these class object has architecture similar to that of array?
Which of these class object has architecture similar to that of array?
What is the output of this program? 1.class array_output {
2.public static void main(String args[])
3.{
4.int array_variable [] = new int[10];
5.for (int i = 0; i < 10; ++i) {
6.array_variable[i] = i;
7.System.out.print(array_variable[i] + " ");
8.i++;
9.}
10.}
11.}
Which right shift operator preserves the sign of the value?
What is the output of this program?
1.class output {
2.public static void main(String args[])
3.{
4.String s1 = "Hello World";
5.String s2 = s1.substring(0 , 4);
6.System.out.println(s2);
7.}
8.}
Which of these keywords can be used to prevent Method overriding?
What is the output of this program?
1.import java.net.*;
2.class networking {
3.public static void main(String[] args) throws UnknownHostException {
4.InetAddress obj1 = InetAddress.getByName("cisco.com");
5.System.out.print(obj1.getHostName());
6.}
7.}
What is the output of this program?
1.import java.util.*;
2.class hashtable {
3.public static void main(String args[]) {
4.Hashtable obj = new Hashtable();
5.obj.put("A", new Integer(3));
6.obj.put("B", new Integer(2));
7.obj.put("C", new Integer(8));
8.obj.clear();
9.System.out.print(obj.size());
10.}
11.}
Which of the following can be operands of arithmetic operators?
What is the output of this program?
1.class Output {
2.public static void main(String args[])
3.{
4.int a = 1;
5.int b = 2;
6.int c;
7.int d;
8.c = ++b;
9.d = a++;
10.c++;
11.b++;
12.++a;
13.System.out.println(a + " " + b + " " + c);
14.}
15.}
What is the output of this program? 1.class access{
2.static int x;
3.void increment(){
4.x++;
5.}
6.}
7.class static_use {
8.public static void main(String args[])
9.{
10.access obj1 = new access();
11.access obj2 = new access();
12.obj1.x = 0;
13.obj1.increment();
14.obj2.increment();
15.System.out.println(obj1.x + " " + obj2.x);
16.}
17.}
Which of the following is correct way of implementing an interface salary by class manager?
What is the output of this program?
1.class output {
2.public static void main(String args[])
3. { String s = "Hello World";
4.int i = s.indexOf('o');
5.int j = s.lastIndexOf('l');
6. System.out.print(i + " " + j);
7.}
8.}
Which of these statements are incorrect?
Which of these classes implements Set interface?
Which right shift operator preserves the sign of the value?
Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
What is the output of this program?
final class A {
1.int i;
2.}
3.class B extends A {
4.int j;
5.System.out.println(j + " " + i);
6.}
7.class inheritance {
8.public static void 9.main(String args[])
10.{
11.B obj = new B();
12.obj.display();
13.}
14.}
What will s2 contain after following lines of code?
String s1 = “one”;
String s2 = s1.concat(“two”)
Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes?
Which of these is a process of writing the state of an object to a byte stream?
Which of these is supported by method overriding in Java?