1. What is the purpose of a programming language?
2. Who created the Java programming language?
3. What was the original name of Java?
4. Name two components of the Java Development Kit (JDK).
5. What is the Java Virtual Machine (JVM)?
6. How does the JVM ensure platform independence for Java programs?
7. What is the Java Runtime Environment (JRE) used for?
8. Explain the difference between JDK and JRE.
9. How do you compile a Java program using the command line?
10. How do you run a compiled Java program?
11. What does the [Link]() method do in Java?
12. Why is object-oriented programming (OOP) important in Java?
13. What is the difference between a class and an object in Java?
14. Name one Java buzzword and explain its significance.
15. What is the primary motivation behind the creation of Java?
16. Name two features of Java that contribute to its security.
17. What is bytecode in Java?.
public class HelloWorld { 5. public static void main(String[] args): Main
public static void main(String[] args) { method, the entry point for the program.
[Link]("Hello, World!"); a. public: Method can be accessed from
} anywhere.
} b. static: Method belongs to the class itself.
1. public: Specifies that the class HelloWorld can c. void: Method does not return any value.
be accessed from anywhere. d. main: Special name recognized as the
2. class: Declares a class in Java, which is a entry point.
blueprint for creating objects. e. String[] args: Parameter list for
3. HelloWorld: Name of the class, matching the command-line arguments.
file name ([Link]). 6. {}: Curly braces define the main method body.
4. {}: Curly braces define the class body. 7. [Link]("Hello, World!");:
Statement to print “Hello, World!” to the
console.
f. [Link]: Predefined class
representing the standard output stream.
g. println: Method of [Link] to print a
string and move to the next line.
Explanation:
Data Min Value Max Value Default Example Wrapper
Type Value Class
byte -128 127 0 byte myByte = 42; Byte
short -32,768 32,767 0 short myShort = 1000; Short
int -2,147,483,648 2,147,483,647 0 int myInt = 12345; Integer
long - 9,223,372,036,854,775,807 0L long myLong = Long
9,223,372,036,85 987654L;
4,775,808
float 1.4e-45 3.4028235e38 0.0f float myFloat = 3.14f; Float
double 4.9e-324 1.7976931348623157e308 0.0 double myDouble = Double
2.718;
char '\u0000' (0) '\uffff' (65,535) '\u0000' char myChar = 'A'; Character
boolean N/A (only true or N/A (only true or false) false boolean myBool = Boolean
false) true;