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
What is web browser <br>​
xeze [42]
An application used to access and view websites
7 0
3 years ago
Read 2 more answers
Identify the operation which is NOT one of the parts of the fivebasic set operations in relational algebra?
wariber [46]

Answer:

Join

Explanation:

Five basic set operators in relational algebra are as follows:

  • Selection - tuple selection
  • Projection - extract columns
  • Cartesian product - cross product of relations
  • Set union - union of two relations
  • Set difference - minus operation on two relations

As we can see, Join is not part of the basic set operations but it is implemented using the Cartesian Product operator.

5 0
3 years ago
What type of collection is created with each assignment statement?
lilavasa [31]

Answer:

tuple

Explanation:

at first its a dictionary but then it is reassigned to a tuple

don't forget tuples are immutable

7 0
2 years ago
What is the abbreviation used for educational sites/?
Dovator [93]
Mainly .com 
educational institutes .edu
8 0
2 years ago
What it the total resistance in a series circuit with two resistors of 100 ohms each?
snow_tiger [21]

Answer:

200Ω

Explanation:

In series circuits, you add the resistances.

3 0
2 years ago
Other questions:
  • Drag the correct type of update to its definition.
    5·1 answer
  • Generally speaking, manufacturing overhead is applied to production by means of a __________ __________ __________, which is com
    11·2 answers
  • When presentations are being shown to an audience of over fifty people, how they should be displayed?
    5·2 answers
  • Jeremy’s office is in an earthquake prone area. His web server is in his office. What step should he take to protect the data on
    5·1 answer
  • One of the disadvantages of an e-marketplace is that it cannot provide a single platform for prices. true or false?
    10·2 answers
  • Which form of currency is not backed by gold today
    14·1 answer
  • Describe the relative benefits of routing over a broadcast style of communication. Is routed traffic more secure than broadcasti
    14·1 answer
  • What color line appears under a word that is spelled incorrectly in power point
    11·2 answers
  • Mobile computing is growing in importance each and every day, and the IT manager must take that into account. Do some web resear
    14·1 answer
  • Why does this website have so many copies of plagiarism?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!