@XXXXXXXX public XXXXXXX XXXXXX(XXXXXX XXX) { XX (XXX == XXXX) { return XXXXX; } XX (getClass() != obj.getClass()) { return XXXXX; } final XXXXXXXXX XXXXX = (XXXXXXXXX) obj; XX (this.XXXXXXXXXXXXX != other.XXXXXXXXXXXXX) { return false; } return XXXX; } }
XXXXXXXXXXXXXXXXX.java with main method
XXXXXX java.XXXX.Scanner; public class Navy_yourInitials {
XXXXXX XXXXXXX XXXXX=XXX Scanner(XXXXXX.in); public static XXXX main(String[] args) { final XXX NUM_SHIPS=X; XXXXXX name; int year,passengerCapacity,cargoCapacity; XXXX []ships=new XXXX[NUM_SHIPS]; System.out.print("Enter XXX XXXX XX XXX ship: "); XXXX=XXXXX.next(); XXXX=getYear(); ships[0]=new XXXX(XXXX, XXXX); System.out.print("Enter the XXXX XX XXX Cruise ship: "); input.XXXXXXXX(); name=input.XXXXXXXX(); System.out.print("XXXXX the year XXXXX ship: "); year=XXXXX.XXXXXXX(); while(true) { XXXXXX.out.print("Enter XXX XXXXXXX XXXXXXXXX capacity XX the cruise: "); XXXXXXXXXXXXXXXXX=input.XXXXXXX(); XX(XXXXXXXXXXXXXXXXX>X) XXXXX; XXXX XXXXXX.out.XXXXXXX("Enter the passenger capacity XXXXXXXX.."); } XXXXX[1]=new XXXXXXXXXX(XXXX, XXXX, XXXXXXXXXXXXXXXXX); XXXXXX.out.XXXXX("Enter XXX name of XXX Cargo ship: "); XXXXX.nextLine(); XXXX=input.nextLine(); XXXXXX.out.XXXXX("Enter the XXXX built XXXX: "); XXXX=XXXXX.nextInt(); while(true) { XXXXXX.out.XXXXX("XXXXX XXX XXXXXXX Cargo XXXXXXXX XX XXX XXXXXX: "); XXXXXXXXXXXXX=input.XXXXXXX(); if(XXXXXXXXXXXXX&XX;0) XXXXX; XXXX XXXXXX.out.XXXXXXX("Enter XXX Cargo XXXXXXXX XXXXXXXX.."); } XXXXX[2]=XXX XXXXXXXXX(XXXX, XXXX, cargoCapacity); XXX(int i=0;i<XXXXXXXXX;i++) { XXXXXX.out.println(XXXXX[i]+"\n"); XXXXXX.out.XXXXXXX("----------------------------------------"); } }
XXXXXXX XXXXXX XXX XXXXXXX() { int year; XXXXX(true) { XXXXXX.out.XXXXX("Enter the year built XXXX: "); XXXX=XXXXX.nextInt(); XX(XXXX&XX;=1900 && XXXX&XX;=XXXX) XXXXX; else XXXXXX.out.XXXXXXX("Pleae XXXXX the XXXX of buit between XXXX XX XXXX inclusive."); } XXXXXX year; } }
output