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 class is used to access actual bits or content information of a URL?
Which of these method of class String is used to extract more than one character at a time a String object?
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 string_class {
2.public static void main(String args[])
3.{
4.String obj = "hello";
5.String obj1 = "world";
6.String obj2 = "hello";
7.System.out.println(obj.equals(obj1) + " " + obj.equals(obj2));
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.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.remove(new String("A"));
9.System.out.print(obj);
10.}
11.}
Which of these keywords is used to prevent content of a variable from being modified?
Which of the following is a method having same name as that of it’s class?
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 = "hello";
7.System.out.println(obj.equals(obj1) + " " + obj.equals(obj2));
8.}
9.}
Which of these methods is used to check for infinitely large and small values?
Which of these is not a bitwise operator?
Which of these method of class String is used to extract more than one character at a time a String object?
What is the output of this program? 1.class asciicodes {
2.public static void main(String args[])
3.{
4.char var1 = 'A';
5.char var2 = 'a';
6.System.out.println((int)var1 + " " + (int)var2);
7.}
8.}
Which of the following is method of System class is used to find how long a program takes to execute?
Which of these is wrapper for simple data type char?
What is the output of this program? 1.class string_demo {
2.public static void main(String args[])
3.{
4.String obj = "I" + "like" + "Java";
5.System.out.println(obj);
6.}
7.}
Which of these method can be used to increase the capacity of ArrayList object manually?
Which of these is wrapper around everything associated with a reply from an http server?
Which keyword is used by method to refer to the object that invoked it?
Which of these keywords is used to define interfaces in Java?
Which of these can be returned by the operator & ?
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);
9.}
10.}
-
-
-
-
Which of the following is method of wrapper Integer for converting the value of an object into int?
Which of the following statements are incorrect?
What is the output of this program?
1.import java.util.*;
2.class Output {
3.public static void main(String args[]) {
4.TreeSet t = new TreeSet();
5.t.add("3");
6.t.add("9");
7.t.add("1"); 8.t.add("4"); t.add("8");
9.System.out.println(t);
10.}
11.}
-
-
-
-
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.}
What is the value returned by function compareTo() if the invoking string is greater than the string compared?
Decrement operator, −−, decreases value of variable by what number?
Which of these tranfer protocol must be used so that URL can be accessed by URLConnection class object?
Which of these is incorrect string literal?
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 keywords cannot be used for a class which has been declared final?
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 method of class String is used to obtain length of String object?
Which of these class is superclass of every class in Java?
A class member declared protected becomes member of subclass of which type?
Which of these method is used to make all elements of an equal to specified value?
What is the output of this program?
1.class operators {
2.public static void main(String args[])
3.{
4.int var1 = 5;
5.int var2 = 6;
6.int var3;
7.var3 = ++ var2 * var1 / var2 + var2;
8.System.out.print(var3);
9.}
10.}
Which of these method of class String is used to extract a single character from a String object?