in Java recategorized by
103 views
1 vote
1 vote

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}$
in Java recategorized by
by
103 views

1 Answer

0 votes
0 votes
option A is the answer
Answer:

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true