Question: ((java)) 3. Wr ite the package statement(s) to put both of these classes that are in separate files in the package named NumberGame located in
3. Wr ite the package statement(s) to put both of these classes that are in separate files in the package named NumberGame located in the directory Numbers. Show where the statement(s) appear in the code below What will the following code print? public class ChangePlaces private int numOne; public static int numTwo 0 public ChangePlaces() numOne- 28 int temp - numTwo; numTwo- numOne; numOne temp; public void increment) numOne . 3; numOne++; numTwo-numTwo-3 % 2; public int getNumOne() return numOne; public class RunMe public static void main(Stringl ] args) ChangePlaces foo-new ChangePlaces( ); foo.increment);ChangePlaces bar new ChangePlaces); bar.numTwo- 56; ChangePlaces baz new ChangePlaces( ); System.outprintin"foo: numOne +foo.getNumOne()+ numTwo-+foo.numTwo); System.out.println("bar: numOne "+bar.getNumOne()+ " numTwo+bar.numTwo); System.out printin("baz: numOne"+baz.getNumOne)+ ", numTwo+baz.numTwo); 1) foo: numOne 2) bar: numOne 3) baz: numOne- , numTwo- , numTwo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
