these are java program.. just write the output of those code without running the program....I need the answer within 20 minutes....it’s very urgent.
1. Write the output of these code block without running a) 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 (); } b) public class TestDemo { int m=5; public void some (int x) { m=x; } public static void main(String args[]) { new Demo (). some (7) ; } }
c) } class Demo extends TestDemo { int m=8; public void some (int x) { super. some (x); System.out.println (m); abstract class Base { abstract public void myfunc(); lic void another () { System.out.println("Another method"); public static void main(String args[]) { Abs a = new Abs (); a. amethod (); } public void myfunc() { System.out.println ("My Func"); } public void amethod () { my func(); } } public class Abs extends Base {
d) class TestChoose { public static void main(String args[]) { int n=2; while (n<=10) { boolean flag=true; int kl=2; while (kl<=n/2+1) { if (n%k1==0) { flag-false; break; } kl++; } if (flag) { } n++; System.out.println(n+" ");
these are java program.. just write the output of those code without running the program....I need the answer within 20
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am