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
fenix001 [56]
4 years ago
8

If x is a string, then x = new String("OH"); and x = "OH"; will accomplish the same thing. Group of answer choices True False

Chemistry
2 answers:
Vinvika [58]4 years ago
5 0

Answer:

True is the correct answer to the above question.

Explanation:

  • If x is a string then it can be assigned by the help of two ways in java:
  • By the help of constructor:- When we write " x = new String("OH");", then it will create a pass a string "OH" into the constructor. It is because the String is a class in java and x is an object created by the constructor of the String class.
  • With the help of assigning: The "x= OH", which assigns the value of x which is an object of String class it can also use the constructor to initialize the "OH" string on the class.
  • The above question states the two scenarios which are defined above. Hence the question statement is true.
Akimi4 [234]4 years ago
5 0

Answer:

"True" is the correct answer to this question.

Explanation:

The program to the given question as follows:

Program:

public class data //defining class

{

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

  {

String x="OH"; //defining string variable x and assign value

System.out.println("assign value: "+x); //print value

x = new String("OH"); //defining instance variable and assign value

System.out.println("assign value by creating instance: "+x); //print value

  }

}

Output:

assign value: OH

assign value by creating instance: OH

Explanation of the program:

In the above java program, a class data is defined, inside the class the main method is declared, In this main method a string variable "x" is defined that holds a value "OH", then we the print function to print this variable value.

In the next line, An instance of variable x is created, which holds a value "OH" in its parameter. In this question, both are correct because both hold the same value.

You might be interested in
All of the information needed to make proteins is coded in DNA by?
marissa [1.9K]
Ribonucleic acid is your answer!
6 0
3 years ago
Read 2 more answers
Fractional distillation is used to seperate mixture of water and ethanol. The temperature of the top of the fractioning column i
mestny [16]

Answer:

condenser higher uuuu

6 0
3 years ago
Which numbers are used? Consider the balanced chemical equation that follows. You are asked to determine how many moles of water
velikii [3]
I am assuming that the balanced equation is 
2H₂ + O₂ ⇒ 2H₂O
Since the hydrogen is the limiting reagent (meaning if the hydrogen runs out the reaction stops), we need to compare the mole ratio between hydrogen and water.

The mole ratio between H₂ and H₂O is 2:2, or 1:1 (as seen on the coefficients of the balanced equation)
And so for every mole of hydrogen, it will be equal to water. Since hydrogen is 4 moles, 4 moles of water would be created.

So we use the coefficients of H₂ and H₂O in order to answer this question.
7 0
4 years ago
Read 2 more answers
Why is chlorine a gas
natulia [17]
BECAUSE:

Chlorine<span> is a </span>gas at room temperature.<span>The melting/boiling point of a substance determines what state of matter it takes at a certain temperature.</span> 
3 0
3 years ago
What type of energy transfer is taking place when someone plays a violin?
Marianna [84]

Answer:

C.

Explanation:

The movement of the bow is Kinetic Energy.

6 0
3 years ago
Other questions:
  • 1.name the gas produced by the reaction between calcium carbonate and dilute hydrochloric acid?
    12·1 answer
  • devise a general method for determining the fractional abundances of two or more isotopes from a mass spectrum. Your method must
    11·1 answer
  • Rutherford proposed that atoms have positive nuclei. Which statement correctly describes the nucleus of an atom?
    15·2 answers
  • What is the answer to this question?
    5·1 answer
  • In what ways could this mountain range change over a very long period of time? Explain
    14·1 answer
  • Select all that apply.
    5·1 answer
  • Maybelline Cousteau’s backup oxygen tank reads 650 torr while on her boat, where the temperature is 27 degrees C. When she dives
    5·1 answer
  • Based on your lab report, provide the chemical reaction that occurs in Benedict's test for the following molecule.​
    15·1 answer
  • Are water and air elements? Explain your answer
    9·1 answer
  • Which one of the following is not an acid?<br><br> a.Option 1<br> b.HOOCCOOH<br> c.H2SO4<br> d.NaCl
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!