What is the output of this program?
1.class increment {
2.public static void main(String args[])
3.{
4.double var1 = 1 + 5;
5.double var2 = var1 / 4;
6.int var3 = 1 + 5;
7.int var4 = var3 / 4;
8.System.out.print(var2 + " " + var4);
9.}
10.}
What is the error in this code? byte b = 50; b = b * 50;
Can 8 byte long data type be automatically type cast to 4 byte float data type?
Which of these access specifiers can be used for a class so that it’s members can be accessed by a different class in the different package?
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.}
What does URL stands for?
What is the output of this program?
1.class Output {
2.public static void main(String args[])
3.{
4.final int a=10,b=20;
5.while(a
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 methods is used to make raw MIME formatted string?
Which of these class is used to create an object whose character sequence is mutable?
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.System.out.print(obj.toString());
9.}
10.}
Which of these jump statements can skip processing remainder of code in its body for a particular iteration?
Which of these method is used to change an element in a LinkedList Object
Which of these method of class String is used to remove leading and trailing whitespaces?
What is the output of this program?
1.class c {
2.public void main( String[] args )
3.{
4.System.out.println( "Hello" + args[0] );
5.}
6.}
Which of these is a process of converting a simple data type into a class?
What is the output of this program?
1.class jump_statments {
2.public static void main(String args[])
3.{
4.int x = 2;
5.int y = 0;
6.for ( ; y < 10; ++y) {
7.if (y % x == 0)
8.continue;
9.else if (y == 8)
10.break;
11.else
12.System.out.print(y + " ");
13.}
14.}
15.}
Which of these class must be used to send a datatgram packets over a connection?
What is the output of this program? 1.class Output {
2.public static void main(String args[])
3.{
4.boolean a = true;
5.boolean b = false;
6.boolean c = a ^ b;
7.System.out.println(!c);
8.}
9.}
Which of these access specifiers can be used for a class so that it’s members can be accessed by a different class in the different package?
Which of these method of InputStream is used to read integer representation of next available byte input?
Which of these can be returned by the operator & ?
Which of these classes implements Set interface?
Which of these method of class String is used to compare two String objects for their equality?
What is the output of this program?
1.class c {
2.public void main( String[] args )
3.{
4.System.out.println( "Hello" + args[0] );
5.}
6.}
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.System.out.println(obj.elementAt(1));
9.}
10.}
What is the output of this program?
1.class output {
2.public static void main(String args[])
3.{
4.StringBuffer s1 = new StringBuffer("Hello");
5.s1.insert(1,"Java");
6.System.out.println(s1);
7.}
8.}
What is the output of this program? 1.class average {
2.public static void 3.main(String args[])
3.{
4.double num[] = {5.5, 10.1, 11, 12.8, 56.9, 2.5};
5.double result;
6.result = 0;
7.for (int i = 0; i < 6; ++i)
8.result = result + num[i];
9.System.out.print(result/6);
10.}
11. }
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.}
Which of these is a wrapper for data type int?
Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?
What is the output of this program?
1.import java.util.*;
2.class Arraylist {
3.public static void main(String args[]) {
4.ArrayList obj = new ArrayList();
5.obj.add("A");
6.obj.add("B");
7.obj.add("C");
8.obj.add(1, "D");
9.System.out.println(obj);
10.}
11.}
-
-
-
-
Which of the following operators can operate on a boolean variable? && == ?:
+=
What is the output of this program?
1.import java.util.*;
2.class Maps {
3.public static void main(String args[]) { 4.TreeMap obj = new TreeMap();
5.obj.put("A", new Integer(1));
6.obj.put("B", new Integer(2));
7.obj.put("C", new Integer(3));
8.System.out.println(obj.entrySet());
9.}
10.}
Which of these is supported by method overriding in Java?
Which of these is a class which uses String as a key to store the value in object?
Which of these selection statements test only for equality?
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 obj = new box();
10.obj.width = 10;
11.obj.height = 2;
12.obj.length = 10;
13.int y = obj.width * obj.height * obj.length;
14.System.out.print(y);
15.}
16.}
Which of these classes provide implementation of map interface?
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.}