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
xxTIMURxx [149]
3 years ago
14

If myClass has a constructor with a parameter of type String, select the other constructor that should be included.

Computers and Technology
1 answer:
JulijaS [17]3 years ago
7 0

Answer:

d. public myClass( ) {. . .}

Explanation:

A constructor is a special method that is called when an object of a class is created. It is also used to initialize the instance variables of the given class. A class may have one or more constructors provided that these constructors have different signatures. A class that does not have a constructor explicitly defined has a default parameterless constructor.

Having said these about a constructor, a few other things are worth to be noted by a constructor.

i. In Java, a constructor has the same name as the name of its class.

For example, in the given class <em>myClass</em>, the constructor(s) should also have the name <em>myClass</em>.

ii. A constructor does not have a return value. It is therefore wrong to write a constructor like this:

<em>public void myClass(){...}</em>

This makes option a incorrect.

iii. When a constructor with parameters is defined, the default parameterless constructor is overridden. This might break the code if some other parts  of the program depend on this constructor. So it is advisable to always explicitly write the default parameterless constructor.

This makes option d a correct option.

Other options b and c may also be correct but there is no additional information in the question to help establish or justify that.

You might be interested in
Each TextField has a text property that's returned by its textProperty method as a StringProperty. The StringProperty method ___
masha68 [24]

Answer:

B: Bind

Explanation:

JavaFX property binding permits the synchronization of the value of two properties in such a way that whenever there is a change in one of the properties, there is an immediate update on the value of the other property. In this way, The StringProperty method bind receives an ObservableValue as an argument. When the ObservableValue changes, the bound property is updated accordingly.

4 0
3 years ago
Macronutrients include carbon, phosphorous, oxygen, sulfur, hydrogen, nitrogen and zinc. (T/F)
kvv77 [185]

Answer:

The answer to your question is False

Explanation:

Macronutrients are complex organic molecules, these molecules give energy to the body, promote the growing and the good regulation of the body. Examples of macromolecules are Proteins, carbohydrates, and Lipids.

Micronutrients are substances that do not give energy to the body but they are essential for the correct functioning of the body. Examples of micronutrients are Vitamins and Minerals.

3 0
3 years ago
When the primary key of one relation is placed in a second relation to represent a relationship, the attribute in the second rel
s2008m [1.1K]
It is called a foreign key
6 0
3 years ago
Name the default<br><br>package of java​
melisa1 [442]
I think it should be Java of package instead
8 0
3 years ago
Your dive computer indicates you need to make a mandatory decompression stop. You buddy's dive computer does not. You should: A.
Sati [7]

Answer: Option C : Make a decompression stop that splits the difference between what your buddy's computer requires and what yours does.

Explanation:

Dive computers are battery-powered computers within a watertight and pressure resistant case. These computers track the dive profile by measuring time and pressure.

hence, making a decompression stop that splits the difference between what your buddy's computer requires and what yours does is the best option.

7 0
3 years ago
Other questions:
  • Susan bought a new sweater on sale for $28.93.she was charged HST of 13%.find the total amount of her bill including taxes.​
    9·1 answer
  • What role do you think mobile devices have played in shaping the world?
    13·1 answer
  • Output a table that show the cube of the numbers 1-15<br> (C++)
    7·1 answer
  • Text line breaks and returns are controlled using which tags?
    5·2 answers
  • In a chassis, the path along which air from a cool air source is conducted, past equipment to cool it, and then out of the rack.
    13·1 answer
  • A technician wants to consolidate and log specific alerts from network devices into a database so maintenance tasks and potentia
    11·1 answer
  • How can a signature be added to an email message? Check all that apply.
    10·2 answers
  • Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a n
    7·2 answers
  • What is the most vulnerable information that should be protected to prevent unauthorized access to your online files and records
    8·1 answer
  • What is added to brining liquid to add flavour​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!