IGNOU MCS-206 – 50 Most Important Questions with Detailed Answers

IT & Software

| 41 views



Unit 1: Java Basics

Q1. What is Java and why is it popular?
Answer:
Java is a general-purpose, object-oriented, high-level programming language developed by Sun Microsystems (1995).
Its popularity comes from:

  • Platform Independence: Write once, run anywhere (WORA).

  • Robust & Secure: Automatic garbage collection, no explicit pointers.

  • Multi-threaded: Supports concurrent programming.

  • Rich API: Built-in libraries.


Q2. Why is Java called platform-independent?
Answer:
Because Java source code is compiled into bytecode, which runs on the Java Virtual Machine (JVM) on any OS (Windows/Linux/Mac).


Q3. Explain JVM, JDK, and JRE.
Answer:

  • JVM (Java Virtual Machine): Executes bytecode.

  • JRE (Java Runtime Environment): JVM + core libraries (for running).

  • JDK (Java Development Kit): JRE + development tools (compiler, debugger).


Q4. Difference between Java and C++.
Answer:

  • Java does not support multiple inheritance using classes (C++ does).

  • Java has automatic garbage collection, C++ requires manual memory management.

  • Java uses JVM for execution, C++ compiles into native code.

  • Java is fully object-oriented, C++ is not (supports procedural + OOP).


Q5. What is Bytecode in Java?
Answer:
Intermediate machine-independent code generated by Java compiler.
It is executed by JVM, ensuring portability.


Unit 2: OOP Concepts

Q6. Explain the four pillars of OOP in Java.
Answer:

  1. Encapsulation: Wrapping data + methods in a class.

  2. Inheritance: Reusing properties of a parent class.

  3. Polymorphism: Same method with different forms (overloading/overriding).

  4. Abstraction: Hiding implementation details.


Q7. Define Class and Object with example.
Answer:

  • Class: Blueprint for creating objects.

class Car { String color; void drive() { System.out.println("Car is driving"); } }
  • Object: Instance of a class.

Car c = new Car(); c.drive();

Q8. What is Encapsulation? Give an example.
Answer:
Encapsulation = hiding data using private variables + public getters/setters.

class Student { private int rollNo; public void setRollNo(int r) { rollNo = r; } public int getRollNo() { return rollNo; } }

Q9. What is Inheritance?
Answer:
Inheritance allows a class to acquire properties of another class using extends.

class Animal { void eat(){ System.out.println("Eating"); } } class Dog extends Animal { void bark(){ System.out.println("Barking"); } }

Q10. Difference between Overloading and Overriding.
Answer:

  • Overloading: Same method name, different parameter list (compile-time).

  • Overriding: Subclass redefines parent method with same signature (runtime).


Q11. What is Abstraction? How is it implemented?
Answer:
Hiding implementation details and exposing only functionality.

  • Abstract Class (with abstract methods).

  • Interface (pure abstraction).


Q12. Can Java support multiple inheritance?
Answer:

  • Not via classes (to avoid ambiguity).

  • Possible using interfaces.


Q13. Explain the this keyword.
Answer:
Refers to the current object. Example:

class Test { int x; Test(int x){ this.x = x; } // distinguishes instance variable }

Q14. Explain the super keyword.
Answer:
Used to access parent class methods/variables/constructors.


Q15. Difference between Abstract Class and Interface.
Answer:

  • Abstract Class: Can have abstract + concrete methods, single inheritance.

  • Interface: Only abstract methods (till Java 7), supports multiple inheritance.


Unit 3: Java Programming

Q16. Difference between Constructor and Method.
Answer:

  • Constructor: Special method for object initialization, no return type.

  • Method: Defines behavior, can return value.


Q17. Types of Constructors.

  • Default constructor.

  • Parameterized constructor.

  • Copy constructor (manual).


Q18. What is static keyword?

  • Belongs to class, not object.

  • Used for variables, methods, blocks.


Q19. What is final keyword?

  • final variable → constant.

  • final method → cannot be overridden.

  • final class → cannot be inherited.


Q20. What is Garbage Collection?
Process of automatic memory management in Java, done by JVM.


Unit 4: Exception Handling

Q21. What is Exception Handling?
Mechanism to handle runtime errors using try-catch-finally.


Q22. Checked vs Unchecked Exceptions.

  • Checked → Compile-time checked (IOException).

  • Unchecked → Runtime errors (ArithmeticException).


Q23. Explain finally block.
Executes always, used for cleanup.


Q24. Difference between throw and throws.

  • throw → Used to throw exception inside method.

  • throws → Declares exception in method signature.


Q25. Example of try-catch.

try { int x = 10/0; } catch(Exception e) { System.out.println("Error: " + e); }

Unit 5: Multithreading

Q26. What is Thread?
Lightweight process.


Q27. Ways to create Thread.

  1. Extending Thread class.

  2. Implementing Runnable interface.


Q28. Process vs Thread.

  • Process: Independent execution.

  • Thread: Subset of process.


Q29. Methods of Thread class.
start(), run(), sleep(), join(), getName().


Q30. What is Synchronization?
Prevents multiple threads from accessing shared resources simultaneously.


Unit 6: Java APIs

Q31. What is a Package?
Collection of related classes & interfaces.


Q32. How to create a Package?

package mypack; class A { ... }

Q33. Difference between import and package.

  • package: Define a package.

  • import: Include external classes.


Q34. Common Java packages.
java.lang, java.util, java.io, java.sql.


Q35. What is Wrapper Class?
Converts primitive data type into objects (Integer, Double).


Unit 7: GUI & Applets

Q36. What is Applet?
Java program that runs in browser.


Q37. Lifecycle of Applet.
init() → start() → paint() → stop() → destroy().


Q38. Applet vs Application.

  • Applet: Runs in browser.

  • Application: Standalone with main().


Q39. What is AWT?
Abstract Window Toolkit → GUI library.


Q40. AWT vs Swing.

  • AWT: Heavyweight, platform-dependent.

  • Swing: Lightweight, platform-independent.


Unit 8: JDBC

Q41. What is JDBC?
API for database access.


Q42. JDBC Architecture.

  • DriverManager

  • Connection

  • Statement

  • ResultSet


Q43. Steps in JDBC Program.

  1. Load driver

  2. Connect DB

  3. Create statement

  4. Execute query

  5. Process results

  6. Close connection


Q44. Statement vs PreparedStatement.

  • Statement → Static SQL.

  • PreparedStatement → Precompiled SQL, prevents SQL injection.


Q45. Example JDBC Code.

Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306/db","user","pass");

Unit 9: Miscellaneous

Q46. What is Serialization?
Converting object to byte stream.


Q47. What is Deserialization?
Reconstructing object from byte stream.


Q48. Java Collection Framework.
Library for data structures (List, Set, Map).


Q49. ArrayList vs LinkedList.

  • ArrayList → Fast random access.

  • LinkedList → Fast insert/delete.


Q50. What is HashMap?
Collection for key-value pairs, no duplicate keys.

Share this Post
About the Author

✍️ Satyendra Singh is a dedicated software educator and creator behind Quizer.in. With a passion for coding, learning, and teaching, he simplifies complex programming topics and builds engaging tools that make learning fun for everyone.

Comments

No comments yet — be the first to comment! 💬
Leave a Comment

Your email address will not be published. Required fields are marked *

Popular Competitive Exam Quizzes