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 the suffix of hollow?
Bogdan [553]

Answer:

Explanation:

yrti

5 0
3 years ago
BRAINLIEST You have a small company and want to keep your costs low, but it is important your employees share data. Which networ
solmaris [256]

Answer:Peer-to-peer

Explanation: I hope this helps

5 0
2 years ago
Read 2 more answers
What is malware? What are some signs that malware may be impacting the performance of your computer? How can you avoid malware?
Anni [7]

Answer:

Malware is a type of software that is specifically designed to disrupt, damage, or gain unauthorized access to a computer system. Malware can be spread through email attachments, online advertisements, websites, and other methods.

Some signs that malware may be impacting the performance of your computer include:

  • Your computer is running more slowly than usual
  • Your computer crashes frequently
  • Your computer has pop-up ads or other unwanted behavior
  • Your default homepage or search engine has changed without your permission
  • You see new icons or programs on your desktop that you didn't install

To avoid malware, you should be cautious when browsing the internet and avoid visiting suspicious websites. You should also avoid opening email attachments from unknown senders, and be wary of online advertisements. You can also protect your computer by using antivirus software and keeping it up to date.

3 0
1 year ago
Write a Scheme function called "sum" which takes an input function func and a nonnegative number n and outputs the value
solong [7]

Answer:

function sum(number) {

      if (number == 1) {

             return 1;

      }

      return number + sum(number -1);

}

Explanation:

This is a recursive function, it means that is a function that calls itself for example: if you call the function with sum(5) the process is :

sum(5)

   |______ 5 + sum(4)

                           |_______ 4 + sum(3)

                                                       |______ 3 + sum(2)

                                                                                   |_____2 + sum(1)

                                                                                                        |_____ 1

                                                                                                 

the result is 1+2+3+4+5 = 15

7 0
3 years ago
(9/5)C+32 write QBASIC expessions for this​
grigory [225]

Answer:

REM PROGRAM TO CONVERT TEMPERATURE IN CELCIUS TO FARENHEIT

CLS

INPUT “ENTER TEMPERATURE IN CELCIUS”; C

F = C * (9 / 5) + 32

PRINT “TEMPERATURE IN FARENHEIT=”; F

END

Explanation:

Your formula suggests a celcius to fahrenheit conversion...

8 0
3 years ago
Other questions:
  • ________ is used to store programs and instructions that are automatically loaded when the computer is turned on.
    14·1 answer
  • In microsoft windows when a window is minimized what happens to that window
    9·1 answer
  • on average, someone with a bachelor’s degree is estimated to earn _______ times more than someone with a high school diploma
    13·1 answer
  • Marginal ________ shows how much money can be made if a producer sells one additional unit of a good.
    7·2 answers
  • The 2 main types of copyright relevant to the recording industry?
    5·2 answers
  • What is copy and paste?
    13·2 answers
  • If your internet were to go out, what steps would you take to troubleshoot to restore your service?
    15·1 answer
  • - Which amongst the following is not a Characteristic of Cloud Computing?
    5·1 answer
  • CALLING ALL DEKUS UWU
    15·2 answers
  • I need help with my work
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!