OOP_Java_I_Answers
OOP_Java_I_Answers
a) javac is the Java compiler that converts Java source code into bytecode (.class files).
Q2
b) Command line arguments are passed to main() and stored in the String[] args array.
c) Frame is a top-level window with a title and border. Methods: setSize(), setVisible().
d) Overloading: same method name, different parameters. Overriding: same method, subclass modifies behavior.
Q3
double b, h;
b) Swing GUI:
- Use JFrame for window
c) File Copy:
Q4
a) AWT vs Swing:
b) User-defined exception:
If input is zero, throw exception. Else, extract and sum first and last digit.
c) Perfect numbers:
Q5
a) final keyword:
b) Inheritance example: