Which of these have highest precedence?
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 is a method of class Date which is used to search weather object contains a date before the specified date?
What is the range of byte data type in Java?
What is the output of this program?
1.class box {
2.int width;
3.int height;
4.int length;
5.}
6.class mainclass {
7.public static void main(String args[])
8.{
9.box obj1 = new box();
10.box obj2 = new box();
11.obj1.height = 1;
12.obj1.length = 2;
13.obj1.width = 1;
14.obj2 = obj1;
15.System.out.println(obj2.height);
16.}
17.}
What is the range of byte data type in Java?
What is the output of this program?
1.class overload {
2.int x;
3.int y;
4.void add(int a){
5.x = a + 1;
6.}
7.void add(int a , int b){
8.x = a + 2;
9.}
10.}
11.class Overload_methods {
12.public static void main(String args[])
13.{
14.overload obj = new overload();
15.int a = 0;
16.obj.add(6, 7);
17.System.out.println(obj.x);
18.}
19.}
Which of these class encapsulate the run time state of an object or an interface?
Which of these method of Object class can clone an object?
Which of these keywords is used to define packages in Java?
Which of the following package stores all the simple data types in java?
Which of these classes provide implementation of map interface?
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.}
Which of these is returned by “greater than”, “less than” and “equal to” operators
What is the output of this program?
1.class Output {
2.public static void main(String args[]) {
3.char a[] = {'a', '5', 'A', ' '};
4.System.out.print(Character.isDigit(a[0]) + " ");
5.System.out.print(Character.isWhitespace(a[3]) + " "); 6.System.out.print(Character.isUpperCase(a[2]));
7.}
8.}
What is the output of this program?
1.import java.util.*;
2.class stack {
3.public static void main(String args[]) {
4.Stack obj = new Stack();
5.obj.push(new Integer(3));
6.obj.push(new Integer(2));
7.obj.pop();
8.obj.push(new Integer(5));
9.System.out.println(obj);
10.}
11.}
What is the output of this program?
1.class test {
2.int a;
3.int b;
4.void meth(int i , int j) {
5.i *= 2;
6.j /= 2;
7.}
8.}
9.class Output {
10.public static void main(String args[])
11.{
12.test obj = new test();
13.int a = 10;
14.int b = 20;
15.obj.meth(a , b);
16.System.out.println(a + " " + b);
17.}
18.}
Which of these access specifiers can be used for an interface?
Which of these methods is used to add elements in vector at specific location?
What is the output of this program?
1.class bitwise_operator {
2.public static void main(String args[])
3.{
4.int a = 3;
5.int b = 6;
6.int c = a | b;
7.int d = a & b;
8.System.out.println(c + " " + d);
9.}
10.}
What is the output of this program?
1.class rightshift_operator {
2.public static void main(String args[])
3.{
4.int x;
5.x = 10;
6.x = x >> 1;
7.System.out.println(x);
8.}
9.}
In the below code, which code fragment should be inserted at line 3 so that the output will be: “123abc 123abc”?
1.StringBuilder sb1 = new StringBuilder("123");
2.String s1 = "123";
3.// insert code here
4.System.out.println(sb1 + " " + s1);
Which of these is a method to clear all the data present in output buffers?
What is the process of defining a method in subclass having same name & type signature as a method in its superclass?
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(5)); 8.obj.removeAll(obj);
9.System.out.println(obj.isEmpty());
10.}
11.}
Which of these operators can skip evaluating right hand operand?
What is the output of this program?
1.class static_out {
2.static int x;
3.static int y;
4.void add(int a, int b){
5.x = a + b;
6.y = x + b;
7.}
8.}
9.class static_use {
10.public static void main(String args[])
11.{
12.static_out obj1 = new static_out();
13.static_out obj2 = new static_out();
14.int a = 2;
15.obj1.add(a, a + 1);
16.obj2.add(5, a);
17.System.out.println(obj1.x + " " + obj2.y);
19.}
20.}
Which of these is a class which uses String as a key to store the value in object?
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.}
Which of these class is used to create servers that listen for either local or remote client programs?
Which of these method Map class is used to obtain an element in the map having specified key?
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.}
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.}
What is the output of this program?
1.class Output {
2.public static void main(String args[]) {
3.double x = 2.0;
4.double y = 3.0;
5.double z = Math.pow( x, y );
6.System.out.print(z);
7.}
8.}
Which of these class encapsulate the run time state of an object or an interface?
Which of these keywords is used by a class to use an interface defined previously?
Which of these method of class String is used to extract a single character from a String object?
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 keywords is used to prevent content of a variable from being modified?
Which of these statement is correct?