1. Home
  2. Training Library
  3. Programming
  4. Programming Courses
  5. Introduction to Java and Environment Setup

Sample Exam Questions and Answers with Tips

Start course
Overview
Difficulty
Beginner
Duration
56m
Students
67
Ratings
5/5
starstarstarstarstar
Description

In this course, we learn about Java technology and get you started with writing and running a Java program. 

Learning Objectives

  • What is the Java programming language?
  • Java Development Kit (JDK)
  • Java Runtime Environment (JRE)
  • Java Virtual Machine (JVM)
  • Integrated Development Environment (IDE)
  • Installation of Eclipse
  • Write a Java program
  • compile and run a Java program

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. If you're ready, let's start solving the questions related to this section. In this question, a Java class named MyClass is given, and the main method is defined in this class. Also, in the main method it is desired to print Hello World to the console. We are asked which code to write in the missing part in order to print Hello World to the console. 

This is one of the simple questions. If you remember, we used the System.out.println statement when we wanted to print something to the console. Therefore the answer will be option A. Let's move on to the next question. In this question, we're asked to mark the wrong one among the statements given about the Java programming language. You can pause the video and reply. I'll be giving the answer on the next slide. Yes, if you selected option D, you have given the correct answer.

If you remember, when we were talking about the features of the Java programming language, we said that the java programming language is an object oriented language. Also, Java is a platform independent language. For example, you can run a code that you compiled in the Windows operating system on the Linux operating system. Again, Java is a robust language. This means that it is reliable. 

It's developed in such a way that puts a lot of effort into checking errors as early as possible. That's why the Java compiler is able to detect even those errors that are not easy to detect by another programming language. But java is not a language that allows operator overloading. Let's move on to the next question. This question is asking about the components included in the JRE, the Java Runtime Environment. If you remember, we tried to explain this on the slide.

Let's remember them again. Java Development Kit, JDK is a software development environment which is used to develop Java applications. This package includes all tools to develop with Java. If you want to develop and run the applications, you are required to set up JDK on your machine. And the JDK contains the Java Runtime Environment, JRE, and development tools. The development tools are compilers, Java debugger, etc. 

Java Runtime environment, JRE, is a software package which bundles the libraries and the Java virtual machine, and other components to run applications written in Java. The JRE is the runtime portion of Java software, which is all you need to run it in your web browser. It contains Java virtual machine, JVM and libraries. So, the correct answer is C. The JRE contains the core components required to run a Java application. Yes. Let's move on to the next question. In this question, we are asked to mark the true one among the statements given about Java. You can pause the video and reply.

I'll be giving the answer on the next slide. Yes. If you selected option D, you have given the correct answer. If you remember, when we were talking about the features of the Java programming language, we said that Java is both a language and a platform. So, the correct answer is D. This question is about the compiling process of an application. When you compile a program written in the Java programming language, the compiler converts the human readable source file into platform independent code that a Java Virtual Machine can understand.

What is this platform independent code called? Pause the video here and try to figure it out yourself. I'll give the answer on the next slide. Yes. If you ticked C, you answered correctly. If you remember, the Java compiler compiles the source code and generates the dot class file. The codes in the dot class file are bytecodes, and this class file can be executed on any platform or operating system by Java Virtual Machine. So, the answer is C. The platform independent code called bytecode. Let's take a short break here. I'll see you in the next video.

 

About the Author
Students
512
Courses
47
Learning Paths
3

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