Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a constructor as indicated. Sample output for below program: Year: 0, VIN: -1 Year: 2009, VIN: 444555666 // ===== Code from file CarRecord.java =====

Define a constructor as indicated. Sample output for below program:

Year: 0, VIN: -1 Year: 2009, VIN: 444555666 
// ===== Code from file CarRecord.java ===== public class CarRecord { private int yearMade; private int vehicleIdNum; public void setYearMade(int originalYear) { yearMade = originalYear; return; } public void setVehicleIdNum(int vehIdNum) { vehicleIdNum = vehIdNum; return; } public void print() { System.out.println("Year: " + yearMade + ", VIN: " + vehicleIdNum); return; } // FIXME: Write constructor, initialize year to 0, vehicle ID num to -1. //your solution goes here// } // ===== end ===== // ===== Code from file CallCarRecord.java ===== public class CallCarRecord { public static void main (String [] args) { CarRecord familyCar = new CarRecord(); familyCar.print(); familyCar.setYearMade(2009); familyCar.setVehicleIdNum(444555666); familyCar.print(); return; } } // ===== end ===== 
 
Please IN JAVA only comment with the //your solution goes here// part! thank you! 

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago