1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OlgaM077 [116]
3 years ago
8

Define a constructor as indicated. Sample output for below program:Year: 0, VIN: -1Year: 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 =====
Computers and Technology
1 answer:
Keith_Richards [23]3 years ago
4 0

Answer:

public CarRecord(){

       yearMade = 0;

       vehicleIdNum = -1;

   }

Explanation:

A constructor is used to initialize an object instantly. It does not have a return type and has the same name as class.

Create a constructor and set the year as 0 and vehicleIdNum as -1.

This constructor is the default constructor, initializes the default values for the variables, for this class.

You might be interested in
Describe a strategy that you could use to win the recess basketball shooting game HORSE. Analyze your strategy’s risks and rewar
kobusy [5.1K]

Answer:

i mean, theres not much strategy to the game at all, its just being able to shoot from hard spots, and obviously have good consistentsy

Explanation:

5 0
4 years ago
Alice just wrote a new app using Python. She tested her code and noticed some of her lines of code are out of order. Which princ
LenKa [72]

Answer:

This is Elijah from FLVS hihi :DDDDDDDDDDDDDDDDDDDDDDDDDDDDD CVS

Explanation:

6 0
3 years ago
Which range function creates the following list of numbers?<br> 76 74 72 70 68 66 64 62
baherus [9]

Answer:

they look like even number

Explanation:

2 4 6 8 10 12 -------seeeeee but not hundred percent sure but plz put me in brainlist

4 0
3 years ago
What is CPU? List its major parts.​
ExtremeBDS [4]

Answer:

The central processing unit is the brain of the computer. it is the part of the computer which performs manipulations. it is also called the microprocessor.

components of the CPU: The control unit, the arithmetic and logic unit, the register and the memory unit.

I hope you understand:-):-)

7 0
2 years ago
A computer is completely compromised when it wont turn on or operate. What is the best way to fix
miskamm [114]

There really is no getting it back, if it is from a virus, then you need to buy a new computer. If it is something internal, depending on what type of computer you have it might just be best to buy a new one. Hope this helps :-)

8 0
3 years ago
Read 2 more answers
Other questions:
  • Are there any tips or helpful advice for people who want to learn Photoshop?
    10·1 answer
  • In addition to MLA, what are some other widely used style guides? Check all that apply.
    6·2 answers
  • If you could make any blog, what would it be about and why?
    9·1 answer
  • What is the purpose of a Program Epic?
    7·2 answers
  • Which tab is used to configure an export to PST in Outlook 2016?
    7·2 answers
  • Write a program that use a switch statement whose controlling expression is the variable area code. If the value of area_code is
    12·1 answer
  • Discuss the causes ,symptoms, preventive measures and treatment of AIDS​
    6·2 answers
  • Which of the following class definition defines a legal abstract class Group of answer choices public class Rectangle abstract {
    15·1 answer
  • NEED HELP ASAP
    13·2 answers
  • What is the earliest age you can collect social security.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!