Java IO and Applets Mcqs
Our collections of Multiple choice questions and answers focuses on study of Java IO and Applets . These questions are chosen from a collection of most authoritative and best reference books on Java. Our aim is to prepare an individual for competitive exams like NTS, GAT, ECAT, University and College entrance exams and various tests and job interviews. One should practice our Mcqs to assimilate Java IO and Applets topic comprehensively.
Java Programming Mcqs
- Data Types Variables and Arrays Mcqs
- Exception Handling in Java Mcqs
- Interfaces and Packages Mcqs
- Java Classes and Methods Mcqs
- Java Event Handling Mcqs
- Java Inheritance Mcqs
- Java IO and Applets Mcqs
- java lang and java io Mcqs
- Java Language Fundamentals Mcqs
- Java Operators and Control Statements Mcqs
- java utilities Mcqs
- Miscellaneous Topics in Java Mcqs
- Multithreading in Java Mcqs
- Serialization and Networking Mcqs
- Session Management and JSP and Servlet Mcqs
- String Handling
Computer MCQS
Sciences MCQS
2. Which of these class is implemented by FilterInputStream class?
InputStream
InputOutputStream
BufferedInputStream
SequenceInputStream
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
4. What is the output of this program?
class output
{
public static void main(String args[])
{
StringBuffer c = new StringBuffer("Hello");
StringBuffer c1 = new StringBuffer(" World");
c.append(c1);
System.out.println(c);
}
}
class output
{
public static void main(String args[])
{
StringBuffer c = new StringBuffer("Hello");
StringBuffer c1 = new StringBuffer(" World");
c.append(c1);
System.out.println(c);
}
}
Hello
World
Helloworld
Hello World
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
5. Which of these class contains the methods print() & println()?
System
System.out
BUfferedOutputStream
PrintStream
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
6. Which of these methods can be used to writing console output?
Print()
Println()
Write()
All of the mentioned
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
7. Which of these classes are used by character streams output operations?
InputStream
Writer
ReadStream
InputOutputStream
8. Which of these class is used to read from a file?
InputStream
BufferedInputStream
FileInputStream
BufferedFileInputStream
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
9. What is the output of this program?
class output
{
public static void main(String args[])
{
String a="hello i love java";
System.out.println(indexof('i')+" "+indexof('o')+" "+lastIndexof('i')+" "+lastIndexof('o') ));
}
}
class output
{
public static void main(String args[])
{
String a="hello i love java";
System.out.println(indexof('i')+" "+indexof('o')+" "+lastIndexof('i')+" "+lastIndexof('o') ));
}
}
6 4 6 9
5 4 5 9
7 8 8 9
4 3 6 9
10. What is the output of this program?
class output
{
public static void main(String args[])
{
char c[]={'a','1','b',' ','A','0'];
for (int i = 0; i < 5; ++i)
{
if(Character.isDigit(c[i]))
System.out.println(c[i]" is a digit");
if(Character.isWhitespace(c[i]))
System.out.println(c[i]" is a Whitespace character");
if(Character.isUpperCase(c[i]))
System.out.println(c[i]" is an Upper case Letter");
if(Character.isUpperCase(c[i]))
System.out.println(c[i]" is a lower case Letter");
i = i + 3;
}
}
}
class output
{
public static void main(String args[])
{
char c[]={'a','1','b',' ','A','0'];
for (int i = 0; i < 5; ++i)
{
if(Character.isDigit(c[i]))
System.out.println(c[i]" is a digit");
if(Character.isWhitespace(c[i]))
System.out.println(c[i]" is a Whitespace character");
if(Character.isUpperCase(c[i]))
System.out.println(c[i]" is an Upper case Letter");
if(Character.isUpperCase(c[i]))
System.out.println(c[i]" is a lower case Letter");
i = i + 3;
}
}
}
a is a lower case Letter is White space character
b is a lower case Letter is White space characte
a is a lower case Letter A is a upper case Letter
a is a lower case Letter 0 is a digit
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
11. What is the output of this program?
class output
{
public static void main(String args[])
{
StringBuffer s1 = new StringBuffer("Hello");
StringBuffer s2 = s1.reverse();
System.out.println(s2);
}
}
class output
{
public static void main(String args[])
{
StringBuffer s1 = new StringBuffer("Hello");
StringBuffer s2 = s1.reverse();
System.out.println(s2);
}
}
Hello
OlleH
HelloolleH
OlleHHello
12. Which of these class contains the methods used to write in a file?
FileStream
FileInputStream
BUfferedOutputStream
FileBufferStream
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
13. Which of these exception is thrown in cases when the file specified for writing is not found?
IOException
FileException
FileNotFoundException
FileInputException
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
14. Which of these methods are used to read in from file?
Get()
Read()
Scan()
ReadFileInput()
15. Which of these values is returned by read() method is end of file (EOF) is encountered?
0
1
-1
Null
16. Which of these exception is thrown by close() and read() methods?
IOException
FileException
FileNotFoundException
FileInputOutputException
Answer & Solution
No Solution for this Answer..! Report or Discus this Question