[go: up one dir, main page]

0% found this document useful (0 votes)
2 views5 pages

Important Questions JAVA

The document outlines important questions across four units related to Java programming, covering topics such as Object-Oriented Programming principles, Java's history and features, the Java Virtual Machine, data types, control statements, inheritance, exception handling, and GUI programming with AWT. Each unit includes specific questions designed to test knowledge and understanding of Java concepts, including practical programming examples. The questions are aimed at providing a comprehensive understanding of Java programming fundamentals.

Uploaded by

Anugrah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Important Questions JAVA

The document outlines important questions across four units related to Java programming, covering topics such as Object-Oriented Programming principles, Java's history and features, the Java Virtual Machine, data types, control statements, inheritance, exception handling, and GUI programming with AWT. Each unit includes specific questions designed to test knowledge and understanding of Java concepts, including practical programming examples. The questions are aimed at providing a comprehensive understanding of Java programming fundamentals.

Uploaded by

Anugrah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Important Questions (UNIT-01)

1. Explain the basic principles of Object-Oriented Programming (OOP). How does Java
implement these principles?

2. Describe the history and key features of Java that distinguish it from other programming
languages.

3. What is the Java Virtual Machine (JVM)? Explain its role in Java program execution.

4. What is Java Bytecode? Why is it called Java’s “magic” bytecode?

5. Differentiate between Java Development Kit (JDK), Java Runtime Environment (JRE), and
Java Virtual Machine (JVM).

6. Explain the lexical structure of a Java program. What are tokens, keywords, literals, and
identifiers? Give examples.

7. List and describe any five primitive data types in Java with examples.

8. Write a Java program to read input from the console using Scanner class. Explain how
input/output is handled in Java.

9. Describe the different types of operators in Java with examples. How is operator
precedence managed?

10. Explain the use of decision control (if, if-else, switch) and loop control (for, while, do-
while) statements in Java with suitable examples.
Important Questions (UNIT-02)
1. How is a class defined in Java? Explain with an example how objects are
created and used.
2. What is the role of constructors in Java? Explain default and parameterized
constructors with examples.
3. Differentiate between nested class and inner class in Java. Provide suitable
code examples.
4. Explain the concept of static members in Java. How are static variables and
methods used?
5. Discuss the argument passing mechanism in Java. Is Java pass-by-value or
pass-by-reference? Justify your answer with an example.
6. How are arrays defined, initialized, and accessed in Java? Write a Java
program to demonstrate the use of a two-dimensional array.
7. What is the difference between String, StringBuffer, and StringBuilder
classes in Java? When should each be used?
8. Explain various operations that can be performed on strings in Java.
Illustrate with appropriate methods and examples.
9. What is polymorphism in Java? Explain its types with suitable examples.
10.Differentiate between method overloading and method overriding in Java.
Provide code examples to illustrate each.
Important Questions (UNIT-03)
1. What are the main benefits of inheritance in Java? Explain with examples.
2. Describe the types of inheritance supported in Java. Why is multiple
inheritance not supported through classes?
3. Explain how data members and methods are inherited in Java. How does
access specifier affect inheritance?
4. What is the role of constructors in inheritance? How is the super keyword
used to invoke parent class constructors?
5. Write a Java program demonstrating single and multilevel inheritance.
Explain the output.
6. What are packages in Java? How are classes and interfaces organized into
packages? Illustrate with an example.
7. Explain the steps to define a user-defined package and use it in a Java
program. Also explain how to set the CLASSPATH.
8. Differentiate between packages and interfaces in Java. How are interfaces
implemented in a program?
9. What is the naming convention for packages in Java? Why is it important?
10.What are standard packages in Java? List some commonly used packages
and their purposes.
Important Questions (UNIT-04)
1. What is the purpose of exception handling in Java? Explain the difference
between checked and unchecked exceptions with examples.
2. Describe the use of try, catch, finally, throw, and throws keywords in Java
exception handling. Provide a suitable example.
3. What are built-in and user-defined exceptions in Java? Write a program to
demonstrate a custom exception.
4. How can multiple exceptions be caught in Java? Illustrate with an example.
5. Explain the life cycle of an applet. Describe the role of each method
involved.
6. What is the difference between an applet and an application in Java? How is
an applet embedded in a web page using the <applet> tag?
7. Write a simple Java applet to display a message on the screen. Explain how
parameters can be passed to applets.
8. What is AWT in Java? Describe its role in GUI programming with examples
of commonly used components.
9. Explain the use of containers and layout managers in Java GUI
programming. How do layout managers help in organizing components?
10.List and describe the major AWT controls and classes used for creating GUI
in Java. Provide a sample program demonstrating the use of any three
controls.

You might also like