Which of these class is used to read and write bytes in a file?
Which of these classes is used for input and output operation when working with bytes?
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 of these methods of httpd class is used to read data from the stream?
Which of these jump statements can skip processing remainder of code in its body for a particular iteration?
What is the value of “d” after this line of code has been executed?
double d = Math.round ( 2.5 + Math.random() );
Which of the following is method of wrapper Float for converting the value of an object into byte?
Which of these constructors is used to create an empty String object?
Which of these method of InputStream is used to read integer representation of next available byte input?
Which of these class contains only floating point functions?
Arrays in Java are implemented as?
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.}
What is the output of this program?
1.import java.io.*;
2.class filesinputoutput {
3.public static void main(String args[]) {
4.InputStream obj = new FileInputStream("inputoutput.java"); 5.System.out.print(obj.available());
6.}
7.}
Note: inputoutput.java is stored in the disk.
A class member declared protected becomes member of subclass of which type?
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 keywords can be used to prevent inheritance of a class?
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 method of ArrayList class is used to obtain present size of an object?
Which of these method is used to change an element in a LinkedList Object
What is the output of this program? 1.class Output {
2.public static void main(String args[])
3.{
4.Object obj = new Object();
5.System.out.print(obj.getclass());
6.}
7.}
Which of these exception is thrown by URL class’s constructors?
Which of the following is method of wrapper Integer for converting the value of an object into int?
Which of these is correct way of calling a constructor having no parameters, of superclass A by subclass B?
Which of these keywords is used to define interfaces in Java?
Which of these method of MimeHeader is used to return the string equivalent of the values stores on MimeHeader?
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);
Which of these is the interface of legacy?
Which of these access specifiers must be used for main() method?
Which of these method is a rounding function of Math class?
Which of these standard collection classes implements all the standard functions on list data structure?
What is the output of this program?
1.class access{
2.public int x;
3.private int y;
4.void cal(int a, int b){
5.x = a + 1;
6.y = b;
7.}
8.void print() {
9.system.out.println(" " + y);
10.}
11.}
12.class access_specifier {
13.public static void main(String args[])
14.{
15.access obj = new access();
16.obj.cal(2, 3);
17.System.out.println(obj.x);
18.obj.print();
19.}
20.}
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.}
What is the process of defining a method in subclass having same name & type signature as a method in its superclass?
Which of these process occur automatically by java run time system?
What is the value of “d” after this line of code has been executed?
double d = Math.round ( 2.5 + Math.random() );
Which of these is a wrapper for data type int?
Which of these methods is used to know host of an URL?
Which of these method is used add an element and corresponding key to a map?
Which of these methods can be used to search an element in a list?