fork download
  1. What will be the output of the below program? class A
  2. {
  3. public void display(int i)
  4. {
  5. System.out.println("Printing value of integer:"+i);
  6. } } class B extends A
  7. {
  8. public void display(byte b)
  9. {
  10. System.out.println("Printing value of byte:"+b);
  11. } } public class Test
  12. {
  13. public static void main(String args[])
  14. {
  15. A obj1 = new B();
  16. byte myByte = 19;
  17.  
  18. obj1.display(myByte);
  19. }
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class, interface, or enum expected
 What will be the output of the below program?   class A
 ^
1 error
stdout
Standard output is empty