Which of these method can be used to increase the capacity of ArrayList object manually?
Which of these standard collection classes implements all the standard functions on list data structure?
Which one is a valid declaration of a boolean?
Which of the following is a method having same name as that of its class?
Which of these is specified by a File object?
Which of these is an on correct statement?
Which of these class is used for operating on request from the client to the server?
Which of these keywords is used to refer to member of base class from a sub class?
What is the output of this program?
1.class output {
2.public static void main(String args[])
3.{
4.String c = "Hello i love java";
5.boolean var;
6.var = c.startsWith("hello");
7.System.out.println(var);
8.}
9.}
Which of these method of class String is used to remove leading and trailing whitespaces?
What is the output of this program?
1.package pkg;
2.class display {
3.int x;
4.void show() {
5.if (x > 1)
6.System.out.print(x + " ");
7.}
8.}
9.class packages {
10.public static void main(String args[]) {
11.display[] arr=new display[3];
12.for(int i=0;i<3;i++)
13.arr[i]=new display();
14.arr[0].x = 0;
15.arr[1].x = 1;
16.arr[2].x = 2;
17.for (int i = 0; i < 3; ++i)
18.arr[i].show();
19.}
20.}
Which of these access specifiers must be used for main() method?
What is the output of this program?
1.class access{
2.public int x;
3.private int y;
4.void cal(int a, int b){
5.x = a + 1;
6.y = b;
7.}
8.}
9.class access_specifier {
10.public static void main(String args[])
11.{
12.access obj = new access();
13.obj.cal(2, 3);
14.System.out.println(obj.x + " " + obj.y);
15.}
16.}
What is the output of this program?
1.class A {
2.public int i;
3.public int j;
4. A() {
5.i = 1;
6.j = 2;
7.}
8. }
9.class B extends A {
10.int a;
11. B() {
12.super();
13.}
14.}
15.class super_use {
16.public static void main(String args[])
17.{
18.B obj = new B();
19.System.out.println(obj.i + " " + obj.j)
20.}
21.}
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.}
What is the numerical range of a char data type in Java?
Which of these is an incorrect array declaration?
What is the output of this program? 1.class string_class {
2.public static void main(String args[])
3.{
4.String obj = "hello";
5.String obj1 = "world";
6.String obj2 = obj;
7.obj2 = " world";
8.System.out.println(obj + " " + obj2);
9.}
10}
What is the output of this program?
1.class bool_operator {
2. public static void main(String args[])
3. {
4. boolean a = true;
5.boolean b = !true;
6.boolean c = a | b;
7.boolean d = a & b;
8.boolean e = d ? b : c;
9.System.out.println(d + " " + e);
10.}
11.}
Which of these standard collection classes implements a linked list data structure?
With x = 0, which of the following are legal lines of Java code for changing the value of x to 1? 1. x++;
2. x = x + 1;
3. x += 1;
4. x =+ 1;
Which of these methods is used to know the type of content used in the URL?
Which of these is wrapper for simple data type char?
Which of these methods is used to make raw MIME formatted string?
What is the output of this program? 1.class mainclass {
2.public static void main(String args[])
3.{
5.char a = 'A';
5.a++;
6.System.out.print((int)a);
7.}
8.}
What is the output of this program?
1.class variable_scope {
2.public static void main(String args[])
3.{
4.int x;
5.x = 5;
6.{
7.int y = 6;
8.System.out.print(x + " " + y);
9.}
10.System.out.println(x + " " + y);
11.}
12.}
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.}
What is the output of this program?
1.class conversion {
2.public static void main(String args[])
3.{
4.double a = 295.04;
5.int b = 300;
6.byte c = (byte) a;
7.byte d = (byte) b;
8.System.out.println(c + " " + d);
9.}
10.}
What is the output of this program?
1.class Output {
2.public static void 3.main(String args[])
4.{
5.int x=y=z=20;
6.}
7.}
Which of these can be returned by the operator & ?
Which of these method of class StringBuffer is used to find the length of current character sequence?
What is the process by which we can control what parts of a program can access the members of a class?
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 , 0, b, 0, a.length);
6.System.out.print(new String(a) + " " + new String(b));
7.}
8.}
What is the output of this program?
1.class evaluate {
2.public static void main(String args[])
3.{
4.int arr[] = new int[] {0 , 1, 2, 3, 4, 5, 6, 7, 8, 9};
5.int n = 6;
6.n = arr[arr[n] / 2];
7.System.out.println(arr[n] / 2);
8.}
9.}
What is the output of this program? 1.class multidimention_array {
2.public static void main(String args[])
3.{
4.int arr[][] = new int[3][];
5.arr[0] = new int[1];
6.arr[1] = new int[2];
7.arr[2] = new int[3];
8.int sum = 0;
9.for (int i = 0; i < 3; ++i)
10.for (int j = 0; j < i + 1; ++j)
11.arr[i][j] = j + 1;
12.for (int i = 0; i < 3; ++i)
13. for (int j = 0; j < i + 1; ++j)
14.sum + = arr[i][j];
15.System.out.print(sum);
16.}
17.}
Which of these classes implements Set interface?
Which of these methods is used to retrieve elements in BitSet object at specific location?
Which of these standard collection classes implements all the standard functions on list data structure?
Which of these method of class String is used to extract a substring from a String object?
What is the output of this program?
1.class box {
2.int width;
3.int height;
4.int length;
5.int volume;
6.box() {
7.width = 5;
8.height = 5;
9.length = 6;
10.}
11.void volume() {
12.volume = width*height*length;
13.}
14.}
15.class constructor_output {
16.public static void main(String args[])
17.{
18.box obj = new box();
19.obj.volume();
20.System.out.println(obj.volume);
21.}
22.}