Programming in java
UNIT 1
❓1. What is Java?
👉 Answer:
Java is a high-level, object-oriented programming language.
❓2. Features of Java
👉 Answer:
Platform independent
Object-oriented
Secure
Robust
❓3. What is JVM?
👉 Answer:
Java Virtual Machine executes Java bytecode.
❓4. What is JDK and JRE?
👉 Answer:
JDK → development tools
JRE → runtime environment
❓5. What is Bytecode?
👉 Answer:
Intermediate code generated after compilation.
❓6. What is Class Loader?
👉 Answer:
Loads class files into JVM.
❓7. What is Garbage Collection?
👉 Answer:
Automatic memory management.
❓8. What is Java Heap?
👉 Answer:
Memory area for objects.
UNIT 2
❓9. What are Data Types?
👉 Answer:
Primitive (int, float, char)
Non-primitive (String, array)
❓10. What is Wrapper Class?
👉 Answer:
Converts primitive into object.
❓11. What is Array?
👉 Answer
Collection of similar elements.
❓12. What is Inheritance?
👉 Answer:
One class acquires properties of another.
❓13. What is Polymorphism?
👉 Answer:
Same method behaves differently.
❓14. What is Abstraction?
👉 Answer:
Hiding implementation details.
❓15. What is Interface?
👉 Answer:
Collection of abstract methods.
❓16. What is Exception?
👉 Answer:
Error during program execution.
❓17. Difference: throw vs throws
👉 Answer:
throw → used to throw exception
throws → declare exception
❓18. What is StringBuffer?
👉 Answer:
Mutable string class.
UNIT 3
❓19. What is Thread?
👉 Answer:
A lightweight process.
❓20. Ways to Create Thread
👉 Answer:
Extend Thread class
Implement Runnable
❓21. What is Synchronization?
👉 Answer:
Controls access of multiple threads.
❓22. What is Deadlock?
👉 Answer:
Threads waiting for each other forever.
❓23. What is AWT?
👉 Answer:
Used for GUI development.
❓24. What is Layout Manager?
👉 Answer:
Arranges components in GUI.
❓25. Types of Layout
👉 Answer:
Flow
Border
Grid
❓26. What is Event?
👉 Answer:
Action like button click.
❓27. What is Listener?
👉 Answer:
Handles events.
UNIT 4
❓28. What is Stream?
👉 Answer:
Flow of data.
❓29. Types of Streams
👉 Answer:
Input stream
Output stream
❓30. What is Serialization?
👉 Answer:
Convert object into byte stream
❓31. What is JDBC?
👉 Answer:
Java Database Connectivity.
❓32. What is Socket?
👉 Answer:
Used for network communication.
❓33. What is RMI?
👉 Answer:
Remote Method Invocation.
❓34. What is Collection Framework?
👉 Answer:
Group of classes for data storage.
❓35. Types of Collection
👉 Answer:
List
Set
Map
🧪 LAB VIVA QUESTIONS (VERY IMPORTANT ⚠️)
🔹 Stack & Queue (Exp 1)
❓36. What is Stack?
👉 Answer:
LIFO (Last In First Out)
❓37. What is Queue?
👉 Answer:
FIFO (First In First Out)
🔹 Tokenizer (Exp 2)
❓38. What is String Tokenizer?
👉 Answer:
Breaks string into tokens.
🔹 Polymorphism (Exp 3)
❓39. What is Dynamic Polymorphism?
👉 Answer:
Method decided at runtime.
🔹 Multithreading (Exp 4)
❓40. What is Producer-Consumer?
👉 Answer:
One thread produces, another consumes.
🔹 Exception (Exp 5)
❓41. What is try-catch?
👉 Answer:
Handles exceptions.
🔹 File Handling (Exp 6–7)
❓42. What is File Handling?
👉 Answer:
Reading and writing files.
🔹 Applet (Exp 8)
❓43. What is Applet?
👉 Answer:
Small Java program running in browser.
🔹 Swing (Exp 9–10)
❓44. What is Swing?
👉 Answer:
Advanced GUI library.
🔹 Servlet (Exp 11)
❓45. What is Servlet?
👉 Answer:
Server-side Java program.
🔹 Java Beans (Exp 12)
❓46. What is Java Bean?
👉 Answer:
Reusable software component.