Decrement operator, −−, decreases value of variable by what number?
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.}
Which of these lines of code will give better performance?
1. a | 4 + c >> b & 7;
2. (a | ((( 4 * c ) >> b ) & 7 ))
Which of these statements are incorrect?
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.}
What is the output of this program?
1.class Output {
2.public static void main(String args[]) {
3.double x = 3.1;
4.double y = 4.5;
5.double z = Math.max( x, y );
6.System.out.print(z);
7.}
8.}
Which of the following statements are incorrect?
Which of these methods can be used to obtain a static array from an ArrayList object?
Which of these method of Object class can generate duplicate copy of the object on which it is called?
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 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/2;
7.array_variable[i]++;
8.System.out.print(array_variable[i] + " ");
9. i++;
10.}
11.}
12.}
Which of these standard collection classes implements all the standard functions on list data structure?
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, 1, b, 3, 0);
6.System.out.print(new String(a) + " " + new String(b));
7.}
8.}
What is the output of this program?
1.import java.io.*;
2.public class filesinputoutput {
3.public static void main(String[] args) {
4.String obj = "abc";
5.byte b[] = obj.getBytes();
6.ByteArrayInputStream obj1 = new ByteArrayInputStream(b);
7.for (int i = 0; i < 2; ++ i) {
8.int c;
9.while ((c = obj1.read()) != -1) {
10.if (i == 0) {
11.System.out.print(Character.toUpperCase((char)c));
12.}
13.}
14.}
15.}
16.}
Which of these method of class String is used to extract a single character from a String object?
Which of the following statements are incorrect?
Which of these is a standard for communicating multimedia content over email?
Which of the following statements are incorrect?
Literal can be of which of these data types?
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.}
Which of the following package stores all the simple data types 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 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 is a method of class Date which is used to search weather object contains a date before the specified date?
Which of these method is used to start a server thread?
What is the output of this program?
1.class output {
2.public static void main(String args[])
3.{
4.StringBuffer c = new StringBuffer("Hello");
5.c.delete(0,2);
6.System.out.println(c);
7.}
8.}
Which of these method of DatagramPacket class is used to find the destination address?
Which of these keywords is used by a class to use an interface defined previously?
Which of these values can a boolean variable contain?
Which of these method is used to start a server thread?
Which of these class is used for operating on request from the client to the server?
Which of these packages contain classes and interfaces used for input & output operations of a program?
What is the output of this program?
1.import java.io.*;
2.public class filesinputoutput {
3.public static void main(String[] args) {
4.String obj = "abc";
5.byte b[] = obj.getBytes();
6.ByteArrayInputStream obj1 = new ByteArrayInputStream(b);
7.for (int i = 0; i < 2; ++ i) {
8.int c;
9.while ((c = obj1.read()) != -1) {
10.if (i == 0) {
11.System.out.print(Character.toUpperCase((char)c));
12.obj2.write(1);
13.}
14.}
15.System.out.print(obj2);
16.}
17.}
18.}
Which operator is used to invert all the digits in binary representation of a number?
What will s2 contain after following lines of code?
StringBuffer s1 = “one”;
StringBuffer s2 = s1.append(“two”)
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.ensureCapacity(3); 7.System.out.println(obj.size());
8.}
9.}
Which of these method is used to change an element in a LinkedList Object?
What is the value of “d” after this line of code has been executed?
double d = Math.round ( 2.5 + Math.random() );
What is the output of the following code?
1.class San
2.{
3.public void m1 (int i,float f)
4.{
5.System.out.println(" int float method");
6.}
7.public void m1(float f,int i);
8.{
9.System.out.println("float int method");
10.}
11.public static void main(String[]args)
12.{
13.San s=new San();
14.s.m1(20,20);
15.}
16.}
What is the output of this program?
1.class evaluate {
2.public static void main(String args[])
3.{
4.int a[] = {1,2,3,4,5};
5.int d[] = a;
6.int sum = 0;
7.for (int j = 0; j < 3; ++j)
8.sum += (a[j] * d[j + 1]) + (a[j + 1] * d[j]);
9.System.out.println(sum);
10.}
11.}
Which of these class holds a collection of static methods and variables?