Would you attempt all 3 questions please?
Posted: Mon Jun 06, 2022 6:52 pm
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
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