Would you attempt all 3 questions please?
1. Write the output of these code block without running (1) class Person ( public Person () { System.out.println("hi!"); } public Person (String s) { this (): System.out.println("I am "+s); } } public class Who extends Person ( public Who () { this ("I am Tony"); } public Who (String s) { super (s); System.out.println("How do you do?"): } public static void main(String args[]) { Who w = new Who (): }
(2) public class TestDemo { int m-5: public void some (int x) { IIFX: ) public static void main(String args[]) { new Demo (). some (7): } } class Deno extends TestDemo { int m=8; public void some (int x) { super. some (x); System.out.println (m): (3) abstract class Base ( abstract public void myfunc(); public void another() { System.out.println("Another method"); public static void main(String args[]) { Abs a = new Abs(): a. amethod(): public void my func(){ System.out.println("My Func"); } public void amethod() ( my func(); public class Abs extends Basel
Would you attempt all 3 questions please?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Would you attempt all 3 questions please?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!