kate1230 kate1230
  • 23-11-2018
  • Computers and Technology
contestada

What is the difference between = and == in terms of java..?

Respuesta :

tonb
tonb tonb
  • 23-11-2018

= is for assignment, == is for comparison.

So x=2 means: assign the value 2 to the variable x.

and

x==2 means: is variable x equal to 2, yes or no?

Answer Link
camiliondez camiliondez
  • 14-10-2020

Answer:

= is used more for define a variable so int Data = 1;

Where == is used to show if something is equal too.

exp of == would be

int Data1 = 1;

int Data2 = 2;

if(Data1 == Data2)

{

System.out.println("Hi")

}

else

System.out.println("Not Equal");

//Output

Not Equal

//Reason was they didnt equal and the boolean was false not true.

Explanation:

Hope this helped!

Answer Link

Otras preguntas

How do markhors get the energy they need to perform their life functions? (WILL PAY GIVE CASH APP) They are skilled hunters that eat small ground mammals for en
Now that you know the molar mass of the empirical formula, you can divide it into the molar mass of your compound to find the scaling factor. What is the scalin
Use the diagram to help you solve the equation 4x - 12 = 16
pleasee help meee ill mark brainiest!! :) tysm
Which of the following people live around Mount Everest and help people climb the mountain? A. Muslims B. government officials from Tibet C. Hindus D. Sherpas
Help asp pleaseeeeee
Pls help with this question
history of science in ghana​
Are there any facts due to which people are misunderstanding you or they get you in a negative way?
what is the answer to this simplified?-3(4x+3)+5x​