Answer to Question #273658 in Java | JSP | JSF for bobo

Question #273658

Modify the given codes to remove the compilation errors. (2 items x 5 points)

1.

public interface Carnivore {

int pieces = 10;

public static void eatGrass();

public int chew() {

return 13;

}

}




2.

interface Haswings {

public int getNumberOfWings();

}

abstract class Insect implements HasWings {

abstract int getNumberOfLegs();

}

public class Dragonfly extends Insect {

int getNumberOfLegs() {

return 6;

}

}


1
Expert's answer
2021-12-01T00:52:43-0500


SOLUTION CODE



interface Carnivore {

    int pieces = 10;

    public static void eatGrass()
      {}

    public int chew();

}


interface HashWings {

    public int getNumberOfWings();

}

abstract class Insect implements HashWings {

    abstract int getNumberOfLegs();

}

 class Dragonfly extends Insect {

    int getNumberOfLegs() {

        return 6;

    }

     @Override
     public int getNumberOfWings() {
         return 0;
     }
 }

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS