package go; package demo; public class Pokemon { import ; // import Pokemon class (#1) public class Main { private int hitPoints; static int population; public static void main(String[) args) { void...


package go;<br>package demo;<br>public class Pokemon {<br>import<br>; // import Pokemon class (#1)<br>public class Main {<br>private int hitPoints;<br>static int population;<br>public static void main(String[) args) {<br>void attack() {<br>// implementation<br>this.evolve();<br>}<br>public void evolve() {<br>// implementation<br>Pokemon pika = new Pokemon();<br>pika.hitPoints = 30; (#2)<br>System.out.print(Pokemon.population);(#3)<br>pika.attack(); (#4)<br>pika.evolve(); (#5)<br>}<br>}<br>1) Which of the following statements is true?<br>a) Since Pokemon is public, the import statement in (#1) is optional<br>b) If Pokemon and Main are in the same package, the import statement in (#1) is no longer needed<br>c) If Pokemon and Main are in the same package, codes in (#2)-(#5) will all be valid<br>d) None of the above<br>|<br>2) Provide the fully qualified name of Pokémon class:<br>

Extracted text: package go; package demo; public class Pokemon { import ; // import Pokemon class (#1) public class Main { private int hitPoints; static int population; public static void main(String[) args) { void attack() { // implementation this.evolve(); } public void evolve() { // implementation Pokemon pika = new Pokemon(); pika.hitPoints = 30; (#2) System.out.print(Pokemon.population);(#3) pika.attack(); (#4) pika.evolve(); (#5) } } 1) Which of the following statements is true? a) Since Pokemon is public, the import statement in (#1) is optional b) If Pokemon and Main are in the same package, the import statement in (#1) is no longer needed c) If Pokemon and Main are in the same package, codes in (#2)-(#5) will all be valid d) None of the above | 2) Provide the fully qualified name of Pokémon class:

Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here