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.}
Which of these method of class String is used to extract a substring from a String object?
Which of these is a return type of getAddress() method of DatagramPacket class?
What is the output of this program?
1.class Output {
2.public static void main(String args[]) {
3.Integer i = new Integer(257);
4.byte x = i.byteValue();
5.System.out.print(x);
6.}
7.}
Which of these method of HashSet class is used to add elements to its object?
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.System.out.println(c.length());
6. }
7. }
What is the output of this program? 1.class Relational_operator {
2.public static void main(String args[])
3.{
4.int var1 = 5;
5.int var2 = 6;
6.System.out.print(var1 > var2);
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((char)c);
12.}
13.}
14.}
15.}
16.}
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.}
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 isinfinite_output {
2.public static void main(String args[]) {
3.Double d = new Double(1 / 0.);
4.boolean x = d.isInfinite();
5.System.out.print(x);
6.}
7.}
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 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 main_class {
2.public static void main(String args[])
3.{
4.int x = 9;
5.if (x == 9) {
6.int x = 8;
7.System.out.println(x);
8.}
9.}
10.}
What will be output of the following code?
1.public class Boxer1 {
2.Integer i;
3. int x;
4.public Boxer1(int y) {
5.x = i+y;
6.System.out.println(x);
7.}
8.public static void main(String[] args) {
9. new Boxer1 (new Integer(4));
10.}
11.}
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 is the interface of legacy?
Which of these methods is used to compare a specific region inside a string with another specific region in another string?
What is the output of this program?
1.class Output {
2.public static void main(String args[]) {
3.ArrayList obj = new ArrayList();
4.obj.add("A");
5.obj.add("D");
6.obj.ensureCapacity(3);
7.obj.trimToSize();
8.System.out.println(obj.size());
9.}
10.}
Which of these class is superclass of all other classes?
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.}
Which of these statements are incorrect?
Which of the following is method of wrapper Float for converting the value of an object into byte?
What is the stored in the object obj in following lines of code?
box obj;
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 keywords is used to make a class?
Which of these method can be used to increase the capacity of ArrayList object manually?
In below code, what can directly access and change the value of the variable name?
1.package test;
2.class Target
3.{
4.public String name = "hello";
5.}
What is the process of defining a method in terms of itself, that is a method that calls itself?
Which of these is an on correct statement?
What is the output of this program?
1.import java.io.*;
2.class files {
3.public static void main(String args[]) {
4.File obj = new File("/java/system");
5.System.out.print(obj.getAbsolutePath());
6.}
7.}
Note: file is made in c drive.
Which of these method Map class is used to obtain an element in the map having specified key?
Which of these methods of httpd class is used to read data from the stream?
Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
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 Output {
2.public static void main(String args[]) {
3.Long i = new Long(256);
4.System.out.print(i.hashCode());
5.}
6.}
Which of these methods can be used to search an element in a list?
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.}
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.}
Which of these is a process of writing the state of an object to a byte stream?