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
marta [7]
2 years ago
6

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

Computers and Technology
2 answers:
Mkey [24]2 years ago
7 0

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!

sukhopar [10]2 years ago
3 0

= 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?

You might be interested in
Copy the countdown function from Section 5.8 of your textbook. def countdown(n): if n <= 0: print('Blastoff!') else: print(n)
Lapatulllka [165]

Answer:

def countdown(n):

   if n <= 0:

       print('Blastoff!')

   else:

       print(n)

       countdown(n-1)

       

def countup(n):

   if n >= 0:

       print('Blastoff!')

   else:

       print(n)

       countup(n+1)

number = int(input("Enter a number: "))

if number >= 0:

   countdown(number)

elif number < 0:

   countup(number)

<u>Outputs:</u>

Enter a number: 3                                                                                                              

3                                                                                                                              

2                                                                                                                              

1                                                                                                                              

Blastoff!

Enter a number: -3                                                                                                              

-3                                                                                                                              

-2                                                                                                                              

-1                                                                                                                              

Blastoff!

Enter a number: 0

Blastoff!

For the input of zero, the countdown function is called.

Explanation:

Copy the countdown function

Create a function called countup that takes one parameter, n. The function counts up from n to 0. It will print the numbers from n to -1 and when it reaches 0, it will print "Blastoff!".

Ask the user to enter a number

Check if the number is greater than or equal to 0. If it is, call the countdown function. Otherwise, call the countup function.

4 0
2 years ago
Class 10 computer unit 1 all excersise​
kenny6666 [7]
Y’all just asking for people do your work, literally not even a question
5 0
3 years ago
Why ues storage unit?​
Jet001 [13]

Huh? I don’t understand your question... please be more specific so we can help you

6 0
3 years ago
What effect does social media have on teens?
myrzilka [38]

Answer:

manipulation is the answer

3 0
2 years ago
Read 2 more answers
What is an easy and accurate way that a graphic designer can increase the size of a digital shape while keeping the ratio of hei
VikaD [51]

Answer:

Open the shape’s properties window, and type the height value multiplied by 2 and the width value multiplied by 3.

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Match each storyboarding technique with its appropriate description
    9·1 answer
  • Write the getNumGoodReviews method, which returns the number of good reviews for a given product name. A review is considered go
    14·1 answer
  • How many packets does your computer send/receive in a single mouse click when you visit a website?
    6·1 answer
  • When did gaming become a thing?
    7·2 answers
  • Explain what middleware is. Name a common middleware in two-tier client/server architecture for database applications.
    10·1 answer
  • You are in the middle of a big project at work. all of your work files are on a server at the office. you want to be able to acc
    14·1 answer
  • Complete the sentence.<br> A ___ number is composed of only zeros and ones.
    8·1 answer
  • Can someone send me reference on communication, importance , communication cycle , pros and cos​
    15·1 answer
  • What is the full form of MOS<br>​
    10·1 answer
  • My computer is being weird, Everytime I begin to type something on here it keeps adding a letter to the beginning of my sentence
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!