Question 1: What is abstraction in Java?
Ans
Abstraction means exposing only the essential behavior of an object while hiding the internal implementation details that a caller doesn't need to know about. In Java, it's achieved mainly through abstract classes and interfaces, which describe what an object can do without necessarily saying how.
Example
javainterface Payment { void pay(double amount); } class UpiPayment implements Payment { public void pay(double amount) { System.out.println("Paid " + amount + " via UPI"); } }
Important Point
A caller using the Payment interface never needs to know how UpiPayment actually processes the payment internally.