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
Klio2033 [76]
3 years ago
6

Consider the following class declaration.

Computers and Technology
1 answer:
seropon [69]3 years ago
4 0
<h2><u>Thing someThing; </u>is the right answer</h2>

Explanation:

A. Thing someThing = new Thing("Green");

This would create a reference type with value "Green". This is because this calls the constructor with one parameter.

B. Thing someThing = new Thing("");

This would create a reference type with value "" (empty). This is because once again it calls constructor with one parameter.

C. Thing someThing = new Thing();

This would set an object with value as "blue". This is because in no argument constructor, the value of the color is set to blue.

D. Thing someThing;

This is the right answer, because it will declare an object but it will not create it. So it has only null value by default.

E. Thing("Green"); This is an invalid statement.

You might be interested in
What read a page on website​
katovenus [111]

Answer:

Dino

Explanation:

3 0
3 years ago
Algorithm to calculate the area of a square.​
podryga [215]

Answer:

length = int(input("Enter a length "))

width = int(input("Enter a width "))

area = length * width

print("The area is " + area)

6 0
3 years ago
Define the missing method. licenseNum is created as: (100000 * customID) licenseYear, where customID is a method parameter. Samp
g100num [7]

Answer:

I am writing the program in JAVA and C++

JAVA:

public int createLicenseNum(int customID){  //class that takes the customID as parameter and creates and returns the licenseNum

       licenseNum = (100000 * customID) + licenseYear;  //licenseNum creation formula

       return(licenseNum);     }

In C++ :

void DogLicense::CreateLicenseNum(int customID){ //class that takes the customID as parameter and creates the licenseNum

licenseNum = (100000 * customID) + licenseYear; } //licenseNum creation formula

Explanation:

createLicenseNum method takes customID as its parameter. The formula inside the function is:

licenseNum = (100000 * customID) + licenseYear;

This multiplies 100000 to the customID and adds the result to the licenseYear and assigns the result of this whole expression to licenseNum.

For example if the SetYear(2014) means the value of licenseYear is set to 2014 and CreateLicenseNum(777) this statement calls createLicenseNum method by passing 777 value as customID to this function. So this means licenseYear = 2014 and customID  = 777

When the CreateLicenseNum function is invoked it computes and returns the value of licenseNum as:

licenseNum = (100000 * customID) + licenseYear;

                     = (100000 * 777) + 2014

                     = 77700000 + 2014

licenseNum = 77702014                                                                                                        

So the output is:

Dog license: 77702014          

To call this function in JAVA:

public class CallDogLicense {

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

    DogLicense dog1 = new DogLicense();//create instance of Dog class

dog1.setYear(2014); // calls setYear passing 2014

dog1.createLicenseNum(777);// calls createLicenseNum passing 777 as customID value

System.out.println("Dog license: " + dog1.getLicenseNum()); //calls getLicenseNum to get the computed licenceNum value

return; } }

Both the programs along with the output are attached as a screenshot.

3 0
4 years ago
Read 2 more answers
A Computer Programmer who wants to be surrounded by a large number of like-minded coworkers should take a job with one of the na
vichka [17]

Answer:

C

Explanation:

This job will have the largest amount of 1. computer programmers, 2. like-minded coworkers, and 3. a large number of like-minded coworkers.

Please give Brainliest if accurate!

7 0
3 years ago
Read 2 more answers
In what year was the first permanent photographic image created?
kvv77 [185]

Answer:

1826

Explanation:

it was in 1826 when the first permanent photographic image was created.

5 0
2 years ago
Other questions:
  • Which style of leadership would be most helpful to Charles in the following situation? Charles has just started an internship at
    15·1 answer
  • 1. What are copyright laws? (6 points)
    15·1 answer
  • Making the data impossible to recover even by applying physical forensics methods is known as __________ of media.
    13·1 answer
  • Your sister asks you if it is possible to get an office productivity suite for free. What do you tell her?
    13·1 answer
  • What function returns a line and moves the file pointer to the next line?
    9·1 answer
  • A folder has been shared with other users and set to read-only. What does this mean for users?
    12·2 answers
  • ____ testing is a straightforward testing technique that looks for vulnerabilities in a program or protocol by feeding random in
    6·1 answer
  • Write code that prints: Ready! userNum ... 2 1 Go! Your code should contain a for loop. Print a newline after each number and af
    6·1 answer
  • Which of the following statements best illustrates how value was created for eggs? when a farmer sells a chicken who is no longe
    9·1 answer
  • Which of the following is not related to text formatting?​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!