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
Scorpion4ik [409]
3 years ago
13

Write the code that creates a public class named Vehicle that has one private data member. The private data member is an integer

variable named modelYear. Create two constructors: Code a constructor that has no parameters and initializes the modelYear variable to 2018. Code a constructor that has one parameter and uses that parameter value to update the modelYear variable.
Computers and Technology
1 answer:
maxonik [38]3 years ago
3 0

Answer:

Following are the program in java

public class Vehicle // class vehicle of type public

{

private int modelYear;

Vehicle() //  no parameters

{

modelYear=2018;

}

vehicle(int t)  // update the value of modelYear

{

modelYear=t;

}

public static void main(String args[]) // main function

{

vehicle ob=new vehicle();// creating instance

vehicle ob1=new vehicle(45);

}

}

Explanation:

Here we create a private data member i.e modelYear of integer type .

We create default constructor and initializes modelYear variable  with 2018.

we create a parametrized constructor  which update the value of modelYear variable.

From the main function we call both the constructors.

You might be interested in
Which of the following technologies is the best choice to convey urgent and highly sensitive information?a. Telephone b. Fax Let
Setler79 [48]

Answer:

C. E-mail

Explanation:

Electronic mail is the best choice to convey urgent and highly sensitive information

8 0
3 years ago
Choose the correct line of code.
Naddika [18.5K]
Def_pow_(self,b): if not then I’m sorry
5 0
3 years ago
1. The opportunity to create several equations for launching program files is called
vladimir1956 [14]

\huge\underline\color{brown}\boxed{☕ANSWER:☕}

_________________________________

1. The opportunity to create several equations for launching program files is called

a) creating a file

b) creating a folder

✒ <u>c) creating a directory</u>

d) creating a shortcut

2. Unless you specify otherwise most spreadsheet packages assume all cell addresses are

a) macros

b) relative cell reference

c) absolute cell reference

✒<u> d) mix cell references</u>

3. Which of the following is not a type of lcon

a) program icon

✒ <u>b) document icon </u>

c) folder icon

d) utility icon

_________________________________

\normalsize\underline\color{yellow}\boxed{TheQuestionner}

\large\mathbb\color{orange}{Correct \: me \: if \: im \: wrong}

7 0
2 years ago
Novice drivers lack the experience necessary to reliably categorize and appropriately respond to ___________ hazards.
meriva

Answer:

roadside

Explanation:

Novice drivers lack the experience necessary to reliably categorize and appropriately respond to roadside hazards. A roadside hazard refers to any roadside objects or features that have a diameter greater than 100mm that is on or near the roadway. These are objects or features that are likely to create a dangerous environment to the drivers.

7 0
3 years ago
Aniyah is setting up a group of computers in her office that will share several devices. Which type of operating system should s
jenyasd209 [6]

Answer:

B

Explanation:

the software needs to share thus should be networked

8 0
2 years ago
Other questions:
  • With a(n) ____ data table you can vary the value in one cell.
    5·1 answer
  • Hi <br> What exactly does this project want from me?thanks for riding
    5·1 answer
  • Assume that LO and HI have already been assigned as constants with LO &lt; HI, and x has been declared as DWORD in the data segm
    7·1 answer
  • How do I connect my CSS file and HTML page together? it's just not wanting to work for me. I have 3 other HTML pages that have t
    12·1 answer
  • Name three actions you can perform on an inserted image.
    7·2 answers
  • Please help me
    10·1 answer
  • Computer can do work very___​
    7·2 answers
  • Consider the following method, inCommon, which takes two Integer ArrayList parameters. The method returns true if the same integ
    15·1 answer
  • Discuss, in detail, the usefulness of graphics and images in program development. Explain the importance of the interface of a c
    7·1 answer
  • I need a C++ program to ask the user to put in different numbers until zero is pressed then the program counts the numbers that
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!