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
Effective note-taking helps support<br><br> action.<br> distinction.<br> distraction.<br> retention.
zloy xaker [14]
It is the last one retention because writing it out will cause it to stick in your brain better
7 0
3 years ago
Read 2 more answers
Any BTS army here
kirill115 [55]
I am bts army unite

5 0
3 years ago
Read 2 more answers
The ____ tool allows a user to connect to the active registry database and make changes that are effective immediately. editreg.
kenny6666 [7]
Regedit is the Answer
3 0
4 years ago
Complete the following method named replaceEvens that receives the parameter numbers which is an array of integers. The method m
Taya2010 [7]

Answer:

Following are the method definition to this question:

public class Neg //defining class Neg

{  

public static void replaceEvens(int[] numbers) //defining a method replaceEvens that accepts array

{

int i; //defining integer variable

for(i = 0 ; i < numbers.length; i++) //defining foop to counts number

{

if(numbers[i]%2 == 0) //defining condition to check number is even  

{

numbers[i] = numbers[i] * -1; //multiply the number by -1

}

}

for(i = 0 ; i < numbers.length; i++) // defining loop print array

{

System.out.print(numbers[i] + " "); //print array

}

}    

public static void main(String[] as)//defining main method  

{

   int[] numbers = {12, 10, 18, 5, 2,22}; //defining array numbers and assign value

   System.out.println("Elements of array: "); //print message

   for(int i = 0 ; i < numbers.length ; i++)  //defining loop to print message

   {

   System.out.print(numbers[i] + " "); //print array

   }

  System.out.println("\n After replaceEvens"); //print message

   replaceEvens(numbers); //calling method replaceEvens

  }

}

Output:

please find the attachment.

Explanation:

  • In the given program a static method replaceEvens is declared, in which array numbers pass as the parameter, inside the for method loop is declared, which counts array number in this loop if block is defined, that check-in array there is an even number.
  • In the condition is true it will multiply the number by -1, and output side the loop it will define another loop to print its value.
  • Inside the main method, a number array is declared, that first prints its value then call the method to print its change value.    

3 0
3 years ago
The file extensions .webm, .m4v, and .ogv are used for:
Angelina_Jolie [31]
Audio and video files
5 0
3 years ago
Other questions:
  • The default primary key for an access database is the id field true or falser
    7·1 answer
  • Sarah's employer purchased a health insurance plan that costs $750 per month. Sarah pays $75 toward the plan each month. What is
    5·2 answers
  • In csma/ca, the amount of time a device is made to wait before it can transmit is called the ____.
    15·1 answer
  • Leslie is looking for better job opportunities in his current career path. Which career planning guideline would help him as he
    6·2 answers
  • Write a function named "list_concat" that takes a list of strings as a parameter and returns the concatenation of all the values
    13·1 answer
  • What is the Piston Displacement having 3-inch bore and 3-inch stroke?
    11·1 answer
  • Please answer it’s timed
    14·1 answer
  • Which term means a cryptography mechanism that hides secret communications within various forms of data?.
    6·1 answer
  • Differentiate between soft copy output and hard copy output?​
    12·2 answers
  • Which utilities are excellent examples of connectivity software, applications that enable you to determine if a connection can b
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!