Java SAQ Mid-1
Java SAQ Mid-1
OOPs in Java provides a structured and organized way to create reusable, modular,
and maintainable code.
Data Abstraction hides internal implementation details, providing a clear interface for
interaction. Example: A car object can be used without knowing its engine
specifications.
Benefits include code reusability, scalability, and security. Applications range from
gaming to real-time systems.
Polymorphism allows methods to perform differently based on the object calling it.
Method overloading is when methods have the same name but different parameters.
Java has primitive (int, float) and reference types (String, arrays).
A superclass is the parent class, and a subclass is the derived child class.
14. What is the purpose of using a method? How do you declare a method?
try holds code that might throw an exception; catch handles the thrown exception.