UNIT TEST – JAVA PROGRAMMING (UNIT I & II)
Maximum Marks: 20 Time: 1 Hour
SECTION – A (1 Mark Each)
*(Fill in the blanks and True/False – Attempt all questions)*
1. Java was developed by ___________ at Sun Microsystems.
2. The extension of a compiled Java file is ___________.
3. True or False: Java supports multiple inheritance through classes.
4. The keyword used to define a constant variable in Java is ___________.
5. True or False: “int” and “Integer” are the same in Java.
SECTION – B (2 Marks Each)
*(Attempt any three)*
1. Differentiate between JDK and JVM.
2. Explain the use of the `final` keyword in Java with an example.
3. Write a short note on type casting in Java.
4. What is the difference between while and do-while loops in Java?
5. Define arrays and explain how a two-dimensional array is declared in Java.
SECTION – C (3 Marks Each)
*(Attempt any three)*
1. Explain the features of Java that make it platform-independent.
2. Write a Java code to display the sum of all elements in a one-dimensional integer array.
3. What are control statements? Explain if-else, switch, and for loop with syntax.
4. Describe the concept of enumerated types in Java with an example.
5. Explain the concept of command line arguments with a sample program.