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]
3 years ago
6

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

Computers and Technology
2 answers:
Mkey [24]3 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]3 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
Which of the following can you use to judge source legitimacy?
Sholpan [36]

Answer:

The answer is A

Explanation:

To judge a sources legitimacy is to find factual evidence on a page. Does the page use sources as well? Does the source come from a domain such as: .edu .gov etc.? Does the author show non opinions? If the answer to these questions is yes then your credible resource is accurate.

3 0
3 years ago
Read 2 more answers
John works as an associate at a construction company. His job is to draft contracts for suppliers. Before he prints the contract
worty [1.4K]

Answer:

The correct answer would be option B, Track changes.

Explanation:

John's job is to make drafts and print them. Before printing them, he sends the copy to the manager to get it checked for any mistakes. John's manager can give suggestions and edit the document where he thinks he needs to do. So he can use the Track changes feature to give his comments or suggestions as well as to edit the document. He will simple open the document, open the Review tab, and Click on the Track changes or comments icon. Here he can click on the text which he wants to edit, and there will be a pan which will keep track of the changes and mark them with red, so that John knows where he has made the changes or given the suggestions.

7 0
3 years ago
Write a program that takes in an integer in the range 20-98 as input. The output is a countdown starting from the integer, and s
S_A_V [24]

Answer:

// program in C++.

#include <bits/stdc++.h>

using namespace std;

int main() {

//  variable  

int num;

cout<<"Enter the number between 20 and 98: ";

// read number

cin >> num;

while(num<20||num>98)

{

   cout<<"Wrong input!!enter number between 20-98 only:";

   cin>>num;

}

cout<<"The output is: ";

while(num % 10 != num /10)

{

// print numbers.  

cout<<num<<" ";

// update num.

num--;

}

// display the number.

cout<<num<<endl;;

return 0;

}

Explanation:

Read a number from user and assign it to variable "num".Check if entered number  is in between 20-98 or not.If input number is less than 20 or greater than 98 then  ask again to enter a number between 20-98 until user enter a valid input.Then print  the countdown from input number till both the digit of number are same.

Output:

Enter the number between 20 and 98: 99                                                                                    

Wrong input!!enter number between 20-98 only:12                                                                            

Wrong input!!enter number between 20-98 only:93                                                                            

The output is: 93 92 91 90 89 88

Enter the number between 20 and 98: 77                                                                                    

The output is: 77

7 0
3 years ago
At the monthly product meeting, one of the Product Owners proposes an idea to address an immediate shortcoming of the product sy
Mrrafil [7]

Answer:

Correct limitation for Attribute Name and value is option

b: Value and name combined must not exceed 400KB

Explanation:

For amazon dynamo db You can have unlimited attribute per item but one attribute cannot exceed 400 kb in size.400Kb is the limit of an item which can be stored in db.

If bigger data is required to store than data is stored some where and links/url to data are stored in the db.

For Item max size is 64KB

7 0
3 years ago
. Write a toString method for this class. The method should return a string containing the base, height and area of the triangle
marta [7]

Answer:

Check the explanation

Explanation:

Circle.java

public class Circle {

private double radius;

public Circle(double r) {

radius = r;

}

public double getArea() {

return Math.PI * radius * radius;

}

public double getRadius() {

return radius;

}

public String toString() {

String str;

str = "Radius: " + radius + "Area: " + getArea();

return str;

}

public boolean equals(Circle c) {

boolean status;

if (c.getRadius() == radius)

status = true;

else

status = false;

return status;

}

public boolean greaterThan(Circle c) {

boolean status;

if (c.getArea() > getArea())

status = true;

else

status = false;

return status;

}

}

I have created a class also to test this class below is the class: -

MainCircle.java

public class MainCircle {

public static void main(String args[]) {

Circle c = new Circle(2.5);

Circle c1 = new Circle(2.5);

Circle c2 = new Circle(4.5);

System.out.println(c);

System.out.println(c1);

System.out.println(c2);

System.out.println("Is c and c1 equal : "+c.equals(c1));

System.out.println("Is c2 greater than c1 : "+c1.greaterThan(c2));

}

}

Output: -

Radius: 2.5Area: 19.634954084936208

Radius: 2.5Area: 19.634954084936208

Radius: 4.5Area: 63.61725123519331

Is c and c1 equal : true

Is c2 greater than c1 : true

7 0
3 years ago
Other questions:
  • You’ve been hired to help with installing cable at a new office building for the local branch of the Social Security Administrat
    14·1 answer
  • The memory allocated for a float value is ____ bytes.
    9·1 answer
  • Ascending and descending are examples of
    5·2 answers
  • The shortcut key to access the spelling and grammar check is _____.
    11·2 answers
  • When designing a suitable and safe flexibility training program, you should set reasonable and appropriate goals depending on wh
    15·1 answer
  • What characteristics of IT careers can be a challenge for employees
    9·2 answers
  • What does XD mean? I keep seeing people say it and I dont know what it means
    6·2 answers
  • What is the example of HTML?​
    13·1 answer
  • All operations used to construct algorithms belong to one of three categories: sequential, conditional, or iterative. Below is a
    15·1 answer
  • kidede secondary school in Kotido district has been selected to participate in the final continental debating competitions with
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!