No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
import java.util.*; import static java.lang.System.*; public class tester { public static void main(String args[]) { Scanner kbReader = new Scanner (in); System.out.print("Enter your integer here."); //enter 3001 int i = kbReader.nextInt( ); int count =0; for(int i = 100; i <= 999; i++) { int factors = 0 ; for … | |
[CODE]import static java.lang.System.*; public class ShipTester { public static void main (String []args) { Ship s1 = new Ship(); s1.setX(3); s1.setY(10); s1.setSPeed(22); out.println(s1.getX()); out.println(s1.getY()); out.println(s1.getSpeed()); out.println(s1);//calls the ToString method Ship s2 = new Ship (3,10, 22); ship s3 = new Ship(5,7 ); s3.setSpeed(19); out.println(s1.equals(s2));//s2 becomes rhs out.println(s1.equals(s3));//s3 becomes rhs } … |