InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
Which of these is a method to clear all the data present in output buffers?(a) clear()(b) flush()(c) fflush()(d) close()This question was posed to me in an interview for internship.Query is from Java.io Byte Streams in section Exploring java.lang & java.io of Java |
|
Answer» RIGHT choice is (B) FLUSH() EASY EXPLANATION: None. |
|
| 52. |
Which of these data type is returned by every method of OutputStream?(a) int(b) float(c) byte(d) none of the mentionedThis question was addressed to me during an interview for a job.The origin of the question is Java.io Byte Streams in division Exploring java.lang & java.io of Java |
|
Answer» Correct option is (d) none of the mentioned |
|
| 53. |
Which of these class is used to read and write bytes in a file?(a) FileReader(b) FileWriter(c) FileInputStream(d) InputStreamReaderI got this question during an interview.I'm obligated to ask this question of Java.io Byte Streams in section Exploring java.lang & java.io of Java |
|
Answer» The correct ANSWER is (c) FileInputStream |
|
| 54. |
Which of these method of InputStream is used to read integer representation of next available byte input?(a) read()(b) scanf()(c) get()(d) getInteger()I had been asked this question by my school teacher while I was bunking the class.This interesting question is from Java.io Byte Streams in section Exploring java.lang & java.io of Java |
|
Answer» CORRECT CHOICE is (a) READ() To EXPLAIN: NONE. |
|
| 55. |
Which of these classes is used for input and output operation when working with bytes?(a) InputStream(b) Reader(c) Writer(d) All of the mentionedThis question was addressed to me during a job interview.Asked question is from Java.io Byte Streams topic in chapter Exploring java.lang & java.io of Java |
|
Answer» The CORRECT choice is (a) InputStream |
|
| 56. |
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 mentionedThis question was posed to me in quiz.My question is based upon Java.io Introduction in portion Exploring java.lang & java.io of Java |
|
Answer» RIGHT ANSWER is (c) directory in disk The explanation: NONE. |
|
| 57. |
Which of these class is not related to input and output stream in terms of functioning?(a) File(b) Writer(c) InputStream(d) ReaderI have been asked this question by my school principal while I was bunking the class.This is a very interesting question from Java.io Introduction in section Exploring java.lang & java.io of Java |
|
Answer» Right option is (a) File |
|
| 58. |
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 mentionedThis question was posed to me during an interview.I need to ask this question from Java.io Introduction topic in portion Exploring java.lang & java.io of Java |
|
Answer» The correct option is (C) java.io |
|
| 59. |
Which of these interface is not a member of java.io package?(a) DataInput(b) ObjectInput(c) ObjectFilter(d) FileFilterThis question was addressed to me in homework.My question is based upon Java.io Introduction in division Exploring java.lang & java.io of Java |
|
Answer» CORRECT CHOICE is (C) ObjectFilter For EXPLANATION: NONE. |
|
| 60. |
Which of these class is not a member class of java.io package?(a) String(b) StringReader(c) Writer(d) FileI have been asked this question by my college director while I was bunking the class.My question comes from Java.io Introduction topic in section Exploring java.lang & java.io of Java |
|
Answer» CORRECT CHOICE is (a) String Explanation: NONE. |
|
| 61. |
Which of these method of Double wrapper can be used to check whether a given value is infinite or not?(a) Infinite()(b) isInfinite()(c) checkInfinite()(d) None of the mentionedThe question was posed to me in an interview for internship.I want to ask this question from Java.lang in section Exploring java.lang & java.io of Java |
|
Answer» The correct ANSWER is (b) isInfinite() |
|
| 62. |
Which of these methods can be used to check whether the given value is a number or not?(a) isNaN()(b) isNumber()(c) checkNaN()(d) checkNumber()The question was posed to me in an interview for internship.The doubt is from Java.lang in chapter Exploring java.lang & java.io of Java |
|
Answer» The CORRECT answer is (a) isNaN() |
|
| 63. |
Which of the following methods return the value as a double?(a) doubleValue()(b) converDouble()(c) getDouble()(d) getDoubleValue()I got this question in an online quiz.This intriguing question comes from Java.lang in division Exploring java.lang & java.io of Java |
|
Answer» RIGHT OPTION is (a) doubleValue() BEST EXPLANATION: NONE. |
|
| 64. |
Which of these method can set the out stream to OutputStream?(a) setStream()(b) setosteam()(c) setOut()(d) streamtoOstream()This question was posed to me in class test.My query is from Java.lang in portion Exploring java.lang & java.io of Java |
|
Answer» RIGHT option is (c) SETOUT() To ELABORATE: NONE. |
|
| 65. |
Which of these is a super class of wrappers Double and Float?(a) Long(b) Digits(c) Float(d) NumberI had been asked this question in class test.My enquiry is from Java.lang topic in section Exploring java.lang & java.io of Java |
|
Answer» The correct answer is (d) Number |
|
| 66. |
Which of these methods loads the specified dynamic library?(a) load()(b) library()(c) loadlib()(d) loadlibrary()The question was asked during an online exam.This intriguing question originated from Java.lang in division Exploring java.lang & java.io of Java |
|
Answer» The correct CHOICE is (a) LOAD() |
|
| 67. |
Which of these methods initiates garbage collection?(a) gc()(b) garbage()(c) garbagecollection()(d) Systemgarbagecollection()The question was posed to me in unit test.The above asked question is from Java.lang topic in chapter Exploring java.lang & java.io of Java |
|
Answer» RIGHT ANSWER is (a) GC() EXPLANATION: NONE. |
|
| 68. |
Which of these exceptions is thrown by methods of System class?(a) IOException(b) SystemException(c) SecurityException(d) InputOutputExceptionI had been asked this question during an interview.This intriguing question originated from Java.lang in portion Exploring java.lang & java.io of Java |
|
Answer» Right answer is (c) SecurityException |
|
| 69. |
Which of these method is a rounding function of Math class?(a) max()(b) min()(c) abs()(d) all of the mentionedI got this question in an international level competition.My doubt is from Java.lang topic in portion Exploring java.lang & java.io of Java |
|
Answer» The correct choice is (d) all of the mentioned |
|
| 70. |
Which of these class contains only floating point functions?(a) Math(b) Process(c) System(d) ObjectThe question was posed to me by my school teacher while I was bunking the class.This intriguing question comes from Java.lang in chapter Exploring java.lang & java.io of Java |
|
Answer» The correct answer is (a) Math |
|
| 71. |
What is the value of double consonant ‘E’ defined in Math class?(a) approximately 3(b) approximately 3.14(c) approximately 2.72(d) approximately 0I have been asked this question in a national level competition.Question is taken from Java.lang topic in section Exploring java.lang & java.io of Java |
|
Answer» The correct ANSWER is (C) APPROXIMATELY 2.72 |
|
| 72. |
Which of these method of Object class can generate duplicate copy of the object on which it is called?(a) clone()(b) copy()(c) duplicate()(d) dito()This question was addressed to me in an interview.The doubt is from Java.lang topic in division Exploring java.lang & java.io of Java |
|
Answer» The CORRECT ANSWER is (a) CLONE() |
|
| 73. |
Which of the following is method of System class is used to find how long a program takes to execute?(a) currenttime()(b) currentTime()(c) currentTimeMillis()(d) currenttimeMillis()This question was addressed to me in an internship interview.I'm obligated to ask this question of Java.lang in section Exploring java.lang & java.io of Java |
|
Answer» The CORRECT OPTION is (C) currentTimeMillis() |
|
| 74. |
Which of these class can encapsulate an entire executing program?(a) Void(b) Process(c) Runtime(d) SystemThe question was posed to me in an interview for job.This interesting question is from Java.lang topic in division Exploring java.lang & java.io of Java |
|
Answer» The CORRECT CHOICE is (B) Process |
|
| 75. |
Which of these class is a superclass of all other classes?(a) Math(b) Process(c) System(d) ObjectThis question was posed to me by my school teacher while I was bunking the class.Enquiry is from Java.lang topic in portion Exploring java.lang & java.io of Java |
|
Answer» The correct answer is (d) Object |
|
| 76. |
Standard output variable ‘out’ is defined in which class?(a) Void(b) Process(c) Runtime(d) SystemThis question was addressed to me during an interview for a job.Enquiry is from Java.lang in chapter Exploring java.lang & java.io of Java |
|
Answer» Right answer is (d) System |
|
| 77. |
Which of the following method of Process class can terminate a process?(a) void kill()(b) void destroy()(c) void terminate()(d) void exit()This question was addressed to me in exam.My doubt is from Java.lang in division Exploring java.lang & java.io of Java |
|
Answer» Correct answer is (b) void destroy() |
|
| 78. |
Which of these class have only one field ‘TYPE’?(a) Void(b) Process(c) System(d) RuntimeThis question was posed to me in an online quiz.This key question is from Java.lang topic in chapter Exploring java.lang & java.io of Java |
|
Answer» Right choice is (a) VOID |
|
| 79. |
Which of the following is method of wrapper Integer for converting the value of an object into int?(a) bytevalue()(b) int intValue();(c) Bytevalue()(d) Byte Bytevalue()I got this question in exam.My enquiry is from Java.lang topic in chapter Exploring java.lang & java.io of Java |
|
Answer» RIGHT option is (B) INT intValue(); To EXPLAIN: None. |
|
| 80. |
Which of the following is a method of wrapper Float for converting the value of an object into byte?(a) bytevalue()(b) byte byteValue()(c) Bytevalue()(d) Byte Bytevalue()This question was addressed to me in examination.The above asked question is from Java.lang Introduction in portion Exploring java.lang & java.io of Java |
|
Answer» The CORRECT OPTION is (B) BYTE byteValue() |
|
| 81. |
Which of these is a wrapper for simple data type char?(a) Float(b) Character(c) String(d) IntegerThis question was addressed to me in quiz.This interesting question is from Java.lang in chapter Exploring java.lang & java.io of Java |
|
Answer» The CORRECT OPTION is (B) Character |
|
| 82. |
Which of these is a super class of wrappers Long, Character & Integer?(a) Long(b) Digits(c) Float(d) NumberThis question was addressed to me in an online quiz.This intriguing question comes from Java.lang in section Exploring java.lang & java.io of Java |
|
Answer» RIGHT ANSWER is (d) Number To elaborate: Number is an abstract class CONTAINING subclasses Double, Float, Byte, Short, INTEGER and Long. |
|
| 83. |
Which of the following methods is a method of wrapper Integer for obtaining hash code for the invoking object?(a) int hash()(b) int hashcode()(c) int hashCode()(d) Integer hashcode()The question was posed to me in an internship interview.This intriguing question originated from Java.lang topic in section Exploring java.lang & java.io of Java |
|
Answer» CORRECT OPTION is (c) INT hashCode() To explain I would say: None. |
|
| 84. |
Which of these is a wrapper for data type int?(a) Integer(b) Long(c) Byte(d) DoubleThis question was posed to me in class test.Question is from Java.lang topic in section Exploring java.lang & java.io of Java |
|
Answer» CORRECT ANSWER is (a) Integer Explanation: NONE. |
|
| 85. |
Which of these methods is used to check for infinitely large and small values?(a) isInfinite()(b) isNaN()(c) Isinfinite()(d) IsNaN()The question was asked in an internship interview.My question is taken from Java.lang Introduction in portion Exploring java.lang & java.io of Java |
|
Answer» The CORRECT answer is (a) isInfinite() |
|
| 86. |
Which of these is a wrapper for simple data type float?(a) float(b) double(c) Float(d) DoubleI got this question by my college director while I was bunking the class.My question comes from Java.lang Introduction in portion Exploring java.lang & java.io of Java |
|
Answer» Correct CHOICE is (C) Float |
|
| 87. |
Which of these is a super class of wrappers Double & Integer?(a) Long(b) Digits(c) Float(d) NumberThe question was asked during an internship interview.This intriguing question originated from Java.lang Introduction topic in division Exploring java.lang & java.io of Java |
|
Answer» CORRECT option is (d) Number The BEST EXPLANATION: Number is an ABSTRACT class CONTAINING subclasses Double, Float, Byte, Short, Integer and Long. |
|
| 88. |
Which of these is a process of converting a simple data type into a class?(a) type wrapping(b) type conversion(c) type casting(d) none of the MentionedThe question was asked in an interview for job.My doubt is from Java.lang Introduction in portion Exploring java.lang & java.io of Java |
|
Answer» RIGHT choice is (a) TYPE wrapping The BEST explanation: NONE. |
|
| 89. |
Which of these classes is not included in java.lang?(a) Byte(b) Integer(c) Array(d) ClassThe question was asked in my homework.The above asked question is from Java.lang Introduction topic in section Exploring java.lang & java.io of Java |
|
Answer» CORRECT ANSWER is (c) ARRAY Easiest explanation: Array class is a MEMBER of java.util. |
|