Which of these is method for testing whether the specified element is a file or a directory?
Which of these is specified by a File object?
Which of these class is necessary to implement datagrams?
What is the output of this program?
1.class String_demo {
2.public static void main(String args[])
3.{
4.int ascii[] = { 65, 66, 67, 68};
5.String s = new String(ascii, 1, 3);
6.ystem.out.println(s);
7.}
8.}
Which of the following package stores all the standard java classes?
Which data type value is returned by all transcendental math functions?
What is the output of this program? 1.class area {
2.public static void main(String args[])
3.{
4.double r, pi, a;
5.r = 9.8;
6.pi = 3.14;
7.a = pi * r * r;
8.System.out.println(a);
9.}
10.}
Which of these can be used to fully abstract a class from its implementation?
Which of these class is used to create servers that listen for either local or remote client programs?
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 array_output {
2.public static void main(String args[])
3.{
4.char array_variable [] = new char[10];
5.for (int i = 0; i < 10; ++i) {
6.array_variable[i] = 'i';
7.System.out.print(array_variable[i] + "");
8.}
9.}
10.}
Which of these classes provide implementation of map interface?
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 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}
Which function is used to perform some action when the object is to be destroyed?
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.}
-
-
-
-
What is the output of this program?
1.class output {
2.public static void main(String args[])
3.{
4.String s1 = "Hello";
5.String s2 = s1.replace('l','w');
6.System.out.println(s2);
7.}
8.}
Which of these class encapsulate the run time state of an object or an interface?
What is the output of this program?
1.class Output {
2.public static void main(String args[])
3.{
4.int x , y = 1;
5.x = 10;
6.if (x != 10 && x / 0 == 0)
7.System.out.println(y);
8.else
9.System.out.println(++y);
10.}
11.}
What is the output of this program?
1.class dynamic_initialization {
2.public static void main(String args[])
3.{
4.double a, b;
5.a = 3.0;
6.b = 4.0;
7.double c = Math.sqrt(a * a + b * b);
8.System.out.println(c);
9.}
10.}
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.capacity());
9.}
10.}
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.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.}
Standard output variable ‘out’ is defined in which class?
What is the output of this program?
1.import java.util.*;
2.class Array {
3.public static void main(String args[]) {
4.int array[] = new int [5];
5.for (int i = 5; i > 0; i--)
6.array[5-i] = i;
7.Arrays.fill(array, 1, 4, 8);
8.for (int i = 0; i < 5 ; i++)
9.System.out.print(array[i]);
10.}
11.}
Which of these keywords can be used to prevent Method overriding?
Which of these method of Array class is used sort an array or its subset?
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.}
Which of the following is method of wrapper Float for converting the value of an object into byte?
What is the output of this program?
1.class selection_statements {
2. public static void main(String args[])
3.{
4.int var1 = 5;
5.int var2 = 6;
6.if ((var2 = 1) == var1)
7.System.out.print(var2);
8.else
9.System.out.print(++var2);
10.}
11.}
Which of these method is called when http daemon is acting like a normal web server?
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 keywords is used by a class to use an interface defined previously?
Which of the following is a method having same name as that of its class?
What is the output of this program?
1.class Abc
2.{
3.public static void .main(String[]args)
4.{
5.String[] elements = { "for", "tea", "too" };
6.String first = (elements.length > 0) ? elements[0]: null;
7.}
8.}
Which of the following statement is correct?
Which of the following are incorrect form of StringBuffer class constructor?
Which of these method is used add an element and corresponding key to a map?
What is the output of this program?
1.import java.util.*;
2.class Maps {
3.public static void main(String args[]) {
4.HashMap obj = new HashMap(); 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.get("B"));
9.}
10.}
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);