Questions List
Browse all explanatory questions of this chapter.
1
What is difference between Path and Classpath?
2
What environment variables do I need to set on my machine in order to be able to run Java programs?
3
Why Generics are used in Java?
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 )
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?
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?
7
If you forget to put a closing quotation mark on a string, what kind error will be raised?
8
Give examples of syntax errors, runtime errors, and logic errors.
9
What are syntax errors (compile errors), runtime errors, and logic errors?
10
Reformat the following program according to the programming style and documentation guidelines. Use the end-of-line brace style.
11
Are there any performance differences between the following two import statements?
import javax.swing.JOptionPane;
import javax.swing.*;
12
Why does the System class not need to be imported?
13
What is the statement to display the message "Hello world" in a message dialog box?
14
If a NoSuchMethodError occurs when you run a program, what is the cause of the error?
15
If a NoClassDefFoundError occurs when you run a program, what is the cause of the error?
16
Can Java run on any machine? What is needed to run Java on a computer?
17
What is the JVM?
18
What is the command to run a Java program?
19
What is the command to compile a Java program?
20
What are the input and output of a Java compiler?
21
What is the Java source filename extension, and what is the Java bytecode file- name extension?
22
Show the output of the following code :
23
What is the statement to display a string on the console?
24
What is a comment? Is the comment ignored by the compiler? How do you denote a comment line and a comment paragraph?
25
Is Java case sensitive? What is the case for Java keywords?
26
What is a keyword? List some Java keywords.
27
Are tools like NetBeans and Eclipse different languages from Java, or are they dialects or extensions of Java?
28
What does IDE stand for?
29
What does JDK stand for?
30