Chapter Questions

Overview of Java Language Questions

Explore chapter-wise explanatory questions and quickly move between related subchapters from a cleaner, more advanced layout.

Questions List

Browse all explanatory questions of this chapter.

30 Total Questions
1

What is difference between Path and Classpath?

Question ID: 237 Read Details
2

What environment variables do I need to set on my machine in order to be able to run Java programs?

Question ID: 224 Read Details
3

Why Generics are used in Java?

Question ID: 223 Read Details
4

Identify and fix the errors in the following code:

1 public class Welcome {
2 public void Main(String[] args) {
3 System.out.println('Welcome to Java!);
4 }
5 )

Question ID: 50 Read Details
5

Suppose you write a program for computing the perimeter of a rectangle and you mistakenly write your program so that it computes the area of a rectangle. What kind of error is this?

Question ID: 49 Read Details
6

If your program needs to read integers, but the user entered strings, an error wouldoccur when running this program. What kind of error is this?

Question ID: 48 Read Details
7

If you forget to put a closing quotation mark on a string, what kind error will be raised?

Question ID: 47 Read Details
8

Give examples of syntax errors, runtime errors, and logic errors.

Question ID: 46 Read Details
9

What are syntax errors (compile errors), runtime errors, and logic errors?

Question ID: 45 Read Details
10

Reformat the following program according to the programming style and documentation guidelines. Use the end-of-line brace style.

Question ID: 44 Read Details
11

Are there any performance differences between the following two import statements?
import javax.swing.JOptionPane;
import javax.swing.*;

Question ID: 43 Read Details
12

Why does the System class not need to be imported?

Question ID: 42 Read Details
13

What is the statement to display the message "Hello world" in a message dialog box?

Question ID: 41 Read Details
14

If a NoSuchMethodError occurs when you run a program, what is the cause of the error?

Question ID: 40 Read Details
15

If a NoClassDefFoundError occurs when you run a program, what is the cause of the error?

Question ID: 39 Read Details
16

Can Java run on any machine? What is needed to run Java on a computer?

Question ID: 38 Read Details
17

What is the JVM?

Question ID: 37 Read Details
18

What is the command to run a Java program?

Question ID: 36 Read Details
19

What is the command to compile a Java program?

Question ID: 35 Read Details
20

What are the input and output of a Java compiler?

Question ID: 34 Read Details
21

What is the Java source filename extension, and what is the Java bytecode file- name extension?

Question ID: 33 Read Details
22

Show the output of the following code :

Question ID: 32 Read Details
23

What is the statement to display a string on the console?

Question ID: 31 Read Details
24

What is a comment? Is the comment ignored by the compiler? How do you denote a comment line and a comment paragraph?

Question ID: 30 Read Details
25

Is Java case sensitive? What is the case for Java keywords?

Question ID: 29 Read Details
26

What is a keyword? List some Java keywords.

Question ID: 28 Read Details
27

Are tools like NetBeans and Eclipse different languages from Java, or are they dialects or extensions of Java?

Question ID: 27 Read Details
28

What does IDE stand for?

Question ID: 26 Read Details
29

What does JDK stand for?

Question ID: 25 Read Details
30

What is an assembly language?

Question ID: 11 Read Details