Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am running a javaTest file with arrays and arraylist, the errors that pop up say certain names can't be used as variables: public static

I am running a javaTest file with arrays and arraylist, the errors that pop up say certain names can't be used as variables: public static void main(String[] args){
Ship cruiseShip1= new CruiseShip(name: "Magic", year: 1998, afloat: true, passengers: 2700, zone: "Caribbean");
Ship cruiseShip2= new CruiseShip(name: "Titanic", year: 1912, afloat: false, passengers: 1300, zone: "Atlantic Ocean");
Ship cargoShip1= new CargoShip(name: "El Faro", year: 1974, afloat: false, cargo: "containers", capacity: 391);
CargoShip cargoShip2= new CargoShip(name: "Seawise Giant", year: 1979, afloat: false, cargo: "crude oil", capacity: 564763);
WarShip warShip = new WarShip(name: "USS Nimitz", year: 1972, afloat: true, type: "super carrier", nation: "United States Navy");

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

Proficiency with Microsoft Word, Excel, PowerPoint

Answered: 1 week ago

Question

Experience with SharePoint and/or Microsoft Project desirable

Answered: 1 week ago