JAVA 7

COEP
Lets Crack Online Exam

IT Interview Exam Questions: JAVA 7 (IT Campus Placement)

Subject: JAVA 7

Part 7: List for questions and answers of JAVA

 

Q1. Which of these stream contains the classes which can work on character stream?

a) InputStream

b) OutputStream

c) Character Stream

d) All of the mentioned

 

Q2. Which of these class is used to read characters in a file?

a) FileReader

b) FileWriter

c) FileInputStream

d) InputStreamReader

 

Q3. Which of these method of FileReader class is used to read characters from a file?

a) read()

b) scanf()

c) get()

d) getInteger()

 

Q4. Which of these class can be used to implement input stream that uses a character array as the source?

a) BufferedReader

b) FileReader

c) CharArrayReader

d) FileArrayReader

 

Q5. Which of these is a method to clear all the data present in output buffers?

a) clear()

b) flush()

c) fflush()

d) close()

 

Q6. Which of these classes can return more than one character to be returned to input stream?

a) BufferedReader

b) Bufferedwriter

c) PushbachReader

d) CharArrayReader 

 

Q7. Which of these packages contain classes and interfaces used for input & output operations of a program?

a) java.util

b) java.lang

c) java.io

d) All of the mentioned

 

Q8. Which of these class is not a member class of java.io package?

a) String

b) StringReader

c) Writer

d) File

 

Q9. Which of these interface is not a member of java.io package?

a) DataInput

b) ObjectInput

c) ObjectFilter

d) FileFilter

 

Q10. Which of these class is not related to input and output stream in terms of functioning?

a) File

b) Writer

c) InputStream

d) Reader

 

Q11. Which of these is specified by a File object?

a) a file in disk

b) directory path

c) directory in disk

d) None of the mentioned

 

Q12. Which of these is method for testing whether the specified element is a file or a directory?

a) IsFile()

b) isFile()

c) Isfile()

d) isfile() 

 

Q13. Which of these class contains the methods used to write in a file?

a) FileStream

b) FileInputStream

c) BUfferedOutputStream

d) FileBufferStream

 

Q14. Which of these exception is thrown in cases when the file specified for writing it not found?

a) IOException

b) FileException

c) FileNotFoundException

d) FileInputException

 

Q15. Which of these methods are used to read in from file?

a) get()

b) read()

c) scan()

d) readFileInput()

 

Q16. Which of these values is returned by read() method is end of file (EOF) is encountered?

a) 0

b) 1

c) -1

d) Null

 

Q17. Which of these exception is thrown by close() and read() methods?

a) IOException

b) FileException

c) FileNotFoundException

d) FileInputOutputException

 

Q18. Which of these methods is used to write() into a file?

a) put()

b) putFile()

c) write()

d) writeFile() 

 

Q19. What does AWT stands for?

a) All Window Tools

b) All Writing Tools

c) Abstract Window Toolkit

d) Abstract Writing Toolkit

 

Q20. Which of these is a type of stream in Java?

a) Integer stream

b) Short stream

c) Byte stream

d) Long stream 

 

Part 7: List for questions and answers of JAVA

 

Q1. Answer: c

 

Q2. Answer: a

 

Q3. Answer: a

 

Q4. Answer: c

 

Q5. Answer: b

 

Q6. Answer: c

 

Q7. Answer: c

 

Q8. Answer: a

 

Q9. Answer: c

 

Q10. Answer: a

 

Q11. Answer: c

 

Q12. Answer: b

 

Q13. Answer: b

 

Q14. Answer: c

 

Q15. Answer: b

 

Q16. Answer: c

 

Q17. Answer: a

 

Q18. Answer: c

 

Q19. Answer: c

 

Q20. Answer: c