logo

Crowdly

The following code has error(s). class Demo{      void msg() {       Syste...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

The following code has error(s).

class Demo{   

  void msg() {  

    System.out.println("1");  

    }    

}    

    

public class Sample extends Demo{    

  @Override

  void msg() throws Exception {    

    System.out.println("2");    

  }  

  

  public static void main(String args[]) {    

   Demo obj = new Sample();    

   obj.msg();    

  }    

More questions like this

Want instant access to all verified answers on lms.upes.ac.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!