recategorized by
398 views
1 votes
1 votes

What is the output of the following program?

abstract class sum
{
    public abstract int sumOfTwo(int n1, int n2);
    public abstract int sumOfThree(int n1, int n2, int n3);
    public void disp(){
        System.out.println("Method of class Sum");
    }
}

class DemoAbstract1 extends Sum
{
    public int sumOfTwo(int num1, int num2)
    {
        return num1+num2;
    }
    public int sumOfThree(int num1, int num2, int num3)
    {
        return num1+num2+num3;
    }
    
    public static void main(String args[]){
        Sum obj=new DemoAbstract1();
        System.out.println(obj.sumOfTwo(3,7));
        System.out.println(obj.sumOfThree(4,3,19));
        obj.disp();
    }
}
  1. $10\\26\\\text{Method of class Sum}$
  2. $26\\10\\\text{Method of class Sum}$
  3. $\text{Method of class Sum}\\26\\10$
  4. $\text{Error}$
recategorized by

1 Answer

Answer:

Related questions

1 votes
1 votes
1 answer
1
gatecse asked Dec 9, 2020
407 views
Which of the following construct is not supported by Java Server Pages?$\text{JSP}$ Directives$\text{JSP}$ Scriptlets$\text{JSP}$ Actions$\text{JSP}$ Reaction
1 votes
1 votes
1 answer
3
gatecse asked Dec 9, 2020
462 views
Which of the following Interface is not supported by $\text{JDBC}$ for connecting to Database in Java Programming language?Statement InterfacePrepared Statement Interface...