image
Sample Exam Questions and Answers with Tips & Tricks
Start course
Difficulty
Beginner
Duration
1h 46m
Students
92
Ratings
5/5
Description

In this course, we'll learn about the Java Input/Output subject.

Learning Objectives

  • API and Java I/O
  • OutputStream Class
  • InputStream Class
  • Reader Class
  • Writer Class
  • Serialization, Deserialization, and Non-Serializable objects

Intended Audience

  • Anyone looking to get Oracle Java Certification
  • Those who want to learn the Java Programming language from scratch
  • Java developers who want to increase their knowledge
  • Beginners with no previous coding experience in Java programming
  • Those who want to learn tips and tricks in Oracle Certified Associate – Java SE 8 Programmer certification exams

Prerequisites

  • No prior knowledge is required about the Java programming language
  • Basic computer knowledge
Transcript

Hi there. In this video, we will solve some sample exam questions together about the topics we learned in this section. If you're ready, let's start. Yes, this question asks, which of the statements in the options is false, pause the video here if you want, and try to solve it yourself. I'll be giving the answer in the next video. Yes, your answer is correct if you selected option B. Now let's examine the options one by one. In option A, it's said that the output stream class is included in the java.io package, this is true. The output stream class is in the java.io package. In option B, it's said that the output stream class does not extend the object class unlike other classes, but this is an incorrect statement. The output stream class extends the object class like any other class. In option C, it's said that the output stream class is an abstract class. This is true. The output stream class is an abstract class. In option D, it said that we can write data to a file, thanks to the output stream class. This is also a correct statement. As a result, the correct answer, that is, the incorrect statement is given in option B. Let's move on to the next question. 

Yes, some expressions are given in the options again in this question. We're asked to take the correct option from these statements. Here, you can pause the video and try to solve it yourself. I'll be giving the answer on the next slide. Yes, your answer is correct if you selected option D. Now let's examine the options one by one. In option A, it says that the input stream class is in java.util package. This is an incorrect statement because the input stream class is included in the java.io package. In option B, there is the statement that the buffered stream class is a subclass of the input stream class, but this is an incorrect statement because there is no class named buffered stream. There are classes buffered input stream or buffered output stream. In option C, it says that the input stream class is an interface but this is also an incorrect statement because the input stream class is an abstract class. 

In option D, it says that the input stream class is the super class of all classes that represent the input stream of bytes. This is a correct statement because the input stream class is a super class of all classes used to read data as bytes. As a result, the correct expression is given in option D. Let's move on to the next question. Yes, some expressions are given in the options again, in this question. We're asked to take the incorrect option from these statements. Here, you can pause the video and try to solve it yourself. I'll be giving the answer on the next slide. Yes, your answer is correct if you selected option B. Now let's examine the options one by one. In option A, there is the statement that the reader class is in the java.io package. This is true. The reader class is also included in the java.io package. Option B states that the reader class is a subclass of the input stream class. This is an incorrect statement. The reader class, like the input stream class, is a subclass of the object class but it is not a subclass of the input stream class. Therefore, the statement in option B is a false statement. 

In option C, there is a statement that the reader class is an abstract class. This is a correct statement. The reader class is also an abstract class. In option D, there is a statement that we can read; character-based data with the reader class. This is also a correct statement. With the input stream class, we can read the data on a byte basis while the reader class can read the data on a character basis. As a result, the correct answer, that is, the incorrect statement is given in option D. Let's move on to the next question. Yes, some expressions are given in the options again in this question. We are asked to take the incorrect option from these statements. Here, you can pause the video and try to solve it yourself. I'll be giving the answer on the next slide. Yes, your answer is correct if you selected option E. Now let's examine the options one by one. In option A, there's the statement that the writer class is in the java.io package. This is true. The writer class is also included in the java.io package. Option B states that the writer class is a subclass of the object class. This is true. 

The writer class, like the output stream class, is a subclass of the object class. In option C, there's a statement that the writer class is an abstract class. This is a correct statement. The writer class is also an abstract class. In option D, there's a statement that we can write character-based data with the writer class. This is also a correct statement. With the output stream class, we can write the data on a byte basis while with the writer class we can write the data on a character basis. In option E, there's a statement that the input stream writer class is a subclass of the writer class but this is an incorrect statement. There is no class called input stream writer anyway. Therefore, the expression in option E is an incorrect expression. Let's move on to the next question. Yes, some expressions are given in the options again in this question. We are asked to take the incorrect option from these statements. Here, you can pause the video and try to solve it yourself. I'll be giving the answer on the next slide. Yes, your answer is correct if you selected option E. Now let's examine the options one by one. 

The expression in option A is, the writer in output stream classes are used to write data. This is a correct statement. Both classes are used to write data. The expression in option B is, the reader and input stream classes are used to read data. This is also a correct statement. Both classes are used to read data. The expression in option C is, the buffered reader class is a well known subclass of the reader class. This is also a correct statement. The buffered reader class is a subclass of the reader class. The expression in option D is, the buffered writer class is a well known subclass of the writer class. This is also a correct statement. The buffered writer class is a subclass of the writer class. The expression in option E is, the string array reader is a well known subclass of the reader class. This is an incorrect statement because there is no class called string array reader. There is a class called char array reader. Therefore the incorrect expression is given in option E. Yes, so we talked about some sample questions that reinforce what we've learned in this chapter. Let's take a break here. See you in the next lesson.

 

About the Author
Students
3888
Courses
64
Learning Paths
5

OAK Academy is made up of tech experts who have been in the sector for years and years and are deeply rooted in the tech world. They specialize in critical areas like cybersecurity, coding, IT, game development, app monetization, and mobile development.

Covered Topics