ExamVeda
Login
Home
61
Which of these methods are used to read in from file?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
62
Which of these values is returned by read() method is end of file (EOF) is encountered?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
63
Which of these exception is thrown by close() and read() methods?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
64
Which of these methods is used to write() into a file?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
65
What will be the output of the following Java program?
import java.io.*;
class filesinputoutput
{
    public static void main(String args[])
    {
        InputStream obj = new FileInputStream("inputoutput.java");
        System.out.print(obj.available());
    }
}

Note: inputoutput.java is stored in the disk.
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
66
What will be the output of the following Java program?
import java.io.*;
public class filesinputoutput
{
  public static void main(String[] args)
    {
 String obj  = "abc";
       byte b[] = obj.getBytes();
       ByteArrayInputStream obj1 = new ByteArrayInputStream(b);
       for (int i = 0; i < 2; ++ i)
       {
           int c;
           while((c = obj1.read()) != -1)
           {
             if(i == 0)
               {
                 System.out.print(Character.toUpperCase((char)c));
                   obj2.write(1); 
             }
           }
           System.out.print(obj2);
       }
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
67
What will be the output of the following Java program?
import java.io.*;
class Chararrayinput
{
    public static void main(String[] args)
    {
  String obj  = "abcdef";
        int length = obj.length();
        char c[] = new char[length];
        obj.getChars(0, length, c, 0);
        CharArrayReader input1 = new CharArrayReader(c);
        CharArrayReader input2 = new CharArrayReader(c, 0, 3);
        int i;
        try
        {
while((i = input2.read()) != -1)
            {
                System.out.print((char)i);
            }
        } 
        catch (IOException e)
        {
            e.printStackTrace();
  }
}
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
68
What will be the output of the following Java program?
import java.io.*;
class Chararrayinput
{
    public static void main(String[] args)
    {
  String obj  = "abcdefgh";
        int length = obj.length();
        char c[] = new char[length];
        obj.getChars(0, length, c, 0);
        CharArrayReader input1 = new CharArrayReader(c);
        CharArrayReader input2 = new CharArrayReader(c, 1, 4);
        int i;
        int j;
        try 
        {
while((i = input1.read()) == (j = input2.read()))
            {
                System.out.print((char)i);
            }
        } 
        catch (IOException e)
        {
            e.printStackTrace();
  }
}
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
69
Which of these functions is called to display the output of an applet?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
70
Which of these methods can be used to output a string in an applet?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board