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
olga_2 [115]
4 years ago
5

In Java, write a constructor in such a way that a Vehicle object with color and type can be constructed directly via, say:

Computers and Technology
1 answer:
olya-2409 [2.1K]4 years ago
5 0

Answer:

Explanation:

  • In Java, a Constructor is similar to that of a method which will be called when creating a new object for the class.
  • There is no return type for a Constructor.
  • public Vehicle (String color, String type)

        {

        colourName = color;

        typeName = type;

        }

  • In Java, you can use new operator to create an object of a class.
  • Here, the object for the class Vehicle is created like Vehicle vehicle = new Vehicle("Pink", "Car");
  • When creating the object of the class, the new operator calls the constructor.
  • If there is no constructor defined explicitly, a default constructor is created by the compiler.
You might be interested in
True / False<br> 1. A byte is a standardized unit of measure that is always 8-bits.
Anna11 [10]

Answer:

TRUE

Explanation:

In telecommunication and computing, there are different units of data storage. The most commonly used units are the bit and the byte.

A bit is the capacity of the system having only two states.

Whereas, the byte, also known as octet, is equal to eight bits. The unit symbol for Byte is B. In many computers, it is the smallest addressable unit of memory.

Therefore, <u>the given statement is TRUE</u>.

6 0
4 years ago
Which tab would you click to open additional excel documents?​
zhenek [66]

The answer of this question is A. File

5 0
3 years ago
Read 2 more answers
The part of the computer that contains the brain, or central processing unit, is also known as the A. monitor. B. keyboard. C. m
Paul [167]

The part of the computer that contains the brain, or central processing unit, is also known as the system unit. Correct answer: D

The system unit contains the main components of a computer. The keyboard, mouse and monitor on the other hands are the peripheral devices.  The system unit contains the CPU, motherboard, hard drive, and RAM.

6 0
3 years ago
Read 2 more answers
Components of an operating system include process,memory,and file management. what is another component of and operating system
kirza4 [7]

Answer:

Wrong it's actually C.

Explanation:

APEX

4 0
3 years ago
Read 2 more answers
Using Word, Maureen is writing an outline of a presentation she plans to give to her company. She will be showing a video during
svlad2 [7]
A copy and paste would be fastest and easiest. As you can pinpoint the exact location to where you want the picture to be. 
5 0
3 years ago
Read 2 more answers
Other questions:
  • g Write a program that asks for the weight of a package and the distance it is to be shipped. This information should be passed
    11·1 answer
  • If you boot your computer from linux live media, you will be able to use a fully-functional linux system prior to installing lin
    5·1 answer
  • A dog walks 10 km north in 2 hours and then 8 km south in 1 hour.
    10·1 answer
  • Problems and Exercises 16 through 43 are based on the entire ("big" version) Pine Valley Furniture Company database. Note: Depen
    13·1 answer
  • The ____________ deals with the well-being of the EMT, career progression, and EMT compensation. Select one: A. EMS administrato
    9·1 answer
  • What allows you to navigate up, down, left and right in a spreadsheet?
    12·1 answer
  • Why hackers hack?? in other people?​
    8·2 answers
  • What is extraction, transformation, and loading? Group of answer choices It is a process of entering data, tracking data, and lo
    5·1 answer
  • How to create diagram that demonstrates the step<br> by step procedures in performing a mail merge.
    12·1 answer
  • Which object event is an indication that something has been created but not committed into the database?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!