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]
3 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]3 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]3 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
A farmer selectively breeds tomatoes to be shipped to grocery stores across the United States. Which of the following genetic tr
Studentka2010 [4]

Answer:

D

Explanation:

It would definitely affect size because breeding will change that trait

5 0
3 years ago
Which mineral(s) might you be examining if you place some hydrochloric (hcl) acid on a sample and it fizzes?
makvit [3.9K]
The minerals that one might be examining if you place some hydrochloric acid on a sample and it fizzes are Calcite and Dolomite.
Calcite and dolomite are very similar minerals. Both have the same hardness, the same rhombohedral cleavage, and are found in identical geologic settings. The best way to tell one from the other is the acid test; A drop of 1 M HCl on calcite produces an instant , obvious Fizz; a drop on dolomite produces slow or no obvious bubbling. 
4 0
3 years ago
Ayyyy Country <br> #12 ⚾<br> how u doin?
mr_godi [17]

Explanation:

you look like a mohammed. im good, hbu?

6 0
3 years ago
Read 2 more answers
The density of water at 30.0 °C is 0.9956 g/mL. If the specific gravity of acetic acid is 1.040 at 30.0 °C, what is the density
mash [69]

Answer:

The density of acetic acid at 30°C = 1.0354_g/mL

Explanation:

specific gravity of acetic acid = (Density of acetic acid at 30°C) ÷ (Density of water at 30°C)

Therefore, the density of acetic acid at 30°C = (Density of water at 30°C) × (Specific gravity of acetic acid at 30°C)

= 0.9956 g/mL × 1.040

= 1.0354_g/mL

Specific gravity, which is also known as relative density, is the ratio of the density of a substance to the density of a specified standard substance.

Generally the standard substance of to which other solid and liquid substances are compared is water which has a density of 1.0 kg per litre or 62.4 pounds/cubic foot at 4 °C (39.2 °F) while gases are normally compared with dry air, with a density of 1.29 grams/litre or 1.29 ounces/cubic foot under standard conditions of a temperature of 0 °C and one standard atmospheric pressure

7 0
3 years ago
How many lone pairs of electrons in lewis structure of CH3 OH
Brums [2.3K]
There would be 2 which would be on the oxygen
4 0
3 years ago
Other questions:
  • How many liters of oxygen gas can react with 84.0 grams of lithium metal at standard temperature and pressure? Show all of the w
    11·2 answers
  • Calculate the height of a column of liquid benzene (d=0.879g/cm3), in meters, required to exert a pressure of 0.790 atm .
    7·2 answers
  • Is mass conserved when 40 G of sodium hydroxide undergoes a chemical change during an interaction with 36.5 grams of hydrogen ch
    7·1 answer
  • How many moles of C are needed to react with 0.500 moles of SO2?
    14·2 answers
  • The empirical formula of a molecule is C2H6. In an experiment, the Molar mass of the molecule was determined to be 90.21g/mol. U
    14·1 answer
  • Which pair shares the same empirical formula?plz help!
    9·2 answers
  • Explain why the speed of sound is faster in solids than in gases. Include two other factors Chapter 17 says the speed of sound c
    11·2 answers
  • Which characteristic is found in liquids and gases? A. Has a fixed volume B. Particles stay in a fixed position C. No particle m
    15·2 answers
  • Match the functions with the corresponding cell structure.
    5·2 answers
  • Which option is an example of a physical change? Question 3 options: baking bread burning paper cooking eggs cutting paper
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!