Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Other

Java Programming Language Quiz

Rating
-
Sold
-
Pages
6
Uploaded on
08-12-2021
Written in
2021/2022

Java Programming Quiz . this quiz will give idea how much do you know about the java programming language. this defiantly help you to boost your knowledge in the field of java. you can use as reference for study.

Institution
Course

Content preview

PROGRAMMING IN JAVA
Assignment7
TYPE OF QUESTION: MCQ
Number of questions: 10 Total mark: 10 × 1 = 10


QUESTION 1:
Which of the following streams contains the classes which can work on character stream?

a. InputStream
b. OutputStream
c. FileReader
d. FileWriter

Correct Answer: c, d

Detailed Solution:
Note: InputStream and OutputStream classes work on byte streams.



QUESTION 2:
Which of the following methods help in clearing the contents of the buffer:

a. flush()
b. clear()
c. close()
d. exit()

Correct Answer: a

Detailed Solution:
Note: Clear() and exit() are not any valid methods defined in any class in java.io package. The
close() method closed a stream.

, QUESTION 3:
In which Java APIs the classes for handling all IO-streams are defined?

a. java.lang
b. java.util
c. java.io
d. java.awt

Correct Answer: b

Detailed Solution:
java.io package is meant for handling io-streams in Java program.




QUESTION 4:
Which of the following statements is/ are NOT true?

a. While you are creating an instance of File class, and if you do not use the file naming
according to the convention of the local machine, the constructor will throw an exception
of class IOException.
b. A File object can be opened for both reading and writing simultaneously.
c. When you create an object of Fileclass for writing, if the corresponding file does not exist
on the local file system, then it will be created.
d. Closing operation of a File object never faces any run-time error and hence need not to be
placed under try-catch block.

Correct Answer: b

Detailed Solution:
You can open a File object either in read or write mode, but not both.

Written for

Institution
Course

Document information

Uploaded on
December 8, 2021
Number of pages
6
Written in
2021/2022
Type
OTHER
Person
Unknown

Subjects

$7.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
vinayakbhatt

Get to know the seller

Seller avatar
vinayakbhatt SGDTP
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
4 year
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions