Lab 5 - Ans
Lab 5 - Ans
Lab 5 - Ans
Lab 5
Find the syntax Errors in the following programs:
1.
class E {}
class F{}
class G extends E,F{}
Ans:
Programming 2 – 2023/2024
Lab 5
Method Override or Overload: Identify the Correct Type
1.
class A {
class B extends A {
obj.print();
Ans: Overriding
Programming 2 – 2023/2024
Lab 5
2.
class A {
int result = a + b;
class B extends A {
int result = a + b + c;
Ans: Overloading
Programming 2 – 2023/2024
Lab 5
3.
class A {
class B extends A {
obj.display(5.5);
Ans: Overloading
Programming 2 – 2023/2024
Lab 5
4.
class A {
class B extends A {
Ans:
Method Call 1: Overloading
Method Call 2: Overriding