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
Joshua takes ownership of all his tasks. Which quality is he demonstrating?
Oxana [17]
Were these the choices?
A. Honesty B. Responsibility C. Approachability D. Confidence E. Resourcefulness 

If so, it would be Letter B - responsibility. He's taking responsibility for the tasks. He's taking the initiative to do the tasks rather than waiting passively for someone to do it.
8 0
3 years ago
Read 2 more answers
How to convert binary to decimal <br> Please it’s so hard and what is digital and analogue
geniusboy [140]

Answer:

How to convert binary to decimal ?

It consists of digits from 0 to 9. Binary to decimal conversion can be done in the simplest way by adding the products of each binary digit with its weight (which is of the form - binary digit × 2 raised to a power of the position of the digit) starting from the right-most digit which has a weight of 20.

what is digital and analogue?

In analog technology, a wave is recorded or used in its original form. So, for example, in an analog tape recorder, a signal is taken straight from the microphone and laid onto tape.In digital technology, the analog wave is sampled at some interval, and then turned into numbers that are stored in the digital device.

8 0
3 years ago
You would like to put the data in order by product number. What should you do?
Dafna11 [192]

If someone wants to put data in order (ascending or descending) they should sort the data.

c. Sort

<u>Explanation:</u>

Sorting is the process of arranging the data on the basis of some property or attribute. Using the find command, conducting a query, and mapping the data would not help.

There are various sorting algorithms like the bubble sort, selection sort, insertion sort, quick sort, and merge sort. Out of all the attributes, one or a combination of attributes can be selected to serve as the basis for sorting.

8 0
3 years ago
The causes of making computer virus​
sasho [114]

Answer:

Damage and chaos. ...

An ego stroke. ...

Monetary or information gain. ...

Stealth. ...

Prevention.

To take control of a computer and use it for specific tasks.

To generate money.

To steal sensitive information (credit card numbers, passwords, personal details, data etc.)

To prove a point, to prove it can be done, to prove ones skill or for revenge purposes.

To cripple a computer or network.

Explanation:

5 0
3 years ago
Read 2 more answers
It is not possible to use keywords to search for themes. true or false.
Drupady [299]
False my dude .........................
3 0
3 years ago
Other questions:
  • What does delegating access give someone the permission to do on behalf of the user? Choose two answers.
    5·1 answer
  • The keyboard, mouse, trackpad, microphone, light pen, and voice recognition are examples of _____ devices.
    5·1 answer
  • Once you have selected the range of cells for your table data, from which tab can you open the Insert Table dialog box?
    6·2 answers
  • Which of the following is not a common network architecture type?
    9·1 answer
  • Which of the following is NOT a web browser?<br> Safari<br> Chrome<br> Bing<br> Firefox
    8·2 answers
  • Insert the components that the computer uses to perform the tasks of each of the parts:
    13·1 answer
  • A(n) _______________ is a collection of configuration and security settings that an administrator has created in order to apply
    14·1 answer
  • 2. What is an inanimate object? (1.0 points)
    14·1 answer
  • What is the command to list the contents of directors in Unix- like operating system
    10·1 answer
  • Choose the answer.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!