Question: Correct the following programs : A ) interface Animal { public void eat _ eat ( ) ; public void travel _ Eat ( )

Correct the following programs :
A)
interface Animal
{
public void eat_eat();
public void travel_Eat();
}
public class MammalInt implements Animal
{
public void eat()
{
System.out.println("Mammal eats");
}
public void travel()
{
System.out.println("Mammal travels");
}
public void noOfLegs()
{
return 0;
}
public static void main(String args[])
{
MammalInt noOfLegs = MammalInt();
m.eat();
m.travel();
}
}
[5 Marks]
B)
Public class ProgramA
{
Public class static main (String[] Args)
{
Call function Sum (10,20);
}
Public void sum (int x,int y);
{
int z;
Z=x+y;
System .......(z)
}
}
[5 Marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!