Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Operator

Functionality

Example/Explanation

=

Sets one value equal to another

counter=0  Sets the counter to equivalent the number 0

+=

Shortcut for adding to the current value.

clicks += 2  Sets the variable named counter to equivalent the current value plus two.

-=

Shortcut for subtracting from the current value.

clicks -= 2  Sets the variable named counter to equivalent the current value minus two.

*=

Shortcut for multiplying the current value.

clicks *= 2  Sets the variable named counter to equivalent the current value multiplied by two.

/=

Shortcut for dividing the current value.

clicks /= 2  Sets the variable named counter to equivalent the current value divided by two.

Description: The comparison operators used to compare two items & return a value of "true"if the condition evaluates to true, else they return false.

Functionality

Example/Explanation

==

Returns a true value if the items are the similar

Counter == 10  Returns the value "true" if the counter's value is equal to the number 10 currently

!=

Returns a true value if the items are not the similar

Counter != 10  Returns the value "true" if the counter's value is any value apart from the number 10

Returns a true value if the item of left is greater than the item of right

counter>10  Returns the value "true" if the counter's value is larger than the number 10

>=

Returns a true value if the item of left is equal to or greater than the item of right

counter>=10  Returns the value "true" if the counter's value is equivalent to or larger than the number 10

Returns a true value if the item of left is less than the item on the right

counter<10  Returns the value "true" if the counter's value is smaller than the number 10

<=

Returns a true value if the item of left is equal to or less than the item of right

counter<=10  Returns the value "true" if the counter's value is equivalent to or less than the number 10

Computational Operators

Description: The computational operators carry out a mathematical function on a value or values, and return a single value.

       operation

 Functionality

Example/Explanation

+

Adds two values together

counter+2  Returns the sum of the counter plus 2

-

Subtracts one value from another

counter-2  Returns the sum of the counter minus

2

*

Multiplies two values

counter*10  Returns the result of variable times 10

/

Divides the value of left by the one on the right and the result returns

counter/2  Divides the current value of the counter through 2 and returns the result

++X

Increments the value, & then returns the result

++counter  Looks at the current value of the counter, increments it through one, and then returns the result. If the counter contains a value of 3, this expression returns the value of 4.

X++

Returns the value, & then increments the value

counter++ Returns the value of the counter, then  do increments in the counter. If the counter contains a value of 3, this expression returns the value of 3, and then sets the counter value to 4.

--X

Decreases the value, & then returns the result

--counter Looks at the current value of the counter, decreases it through one, and then returns the result. If the counter contain a value of 7, this expression returns the value of 6.

X--

Returns the value, and then decreases the value

counter--  Returns the value of the counter, then decreases the counter value. If the counter contains a value of seven, this expression returns the value of seven, then sets the counter value to six

Java, Programming

  • Category:- Java
  • Reference No.:- M9539033

Have any Question?


Related Questions in Java

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Can someone please help me with the following java

can someone please help me with the following java question The input is an N by N matrix of nonnegative integers. Each individual row is a decreasing sequence from left to right. Each individual column is a decreasing s ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Project requirementsfor the problem described in the next

Project requirements For the problem described in the next section, you must do the following: 1. include your student ID at the end of all filenames for all java code files. Three classes have been identified in section ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Assignment game prototypeoverviewfor this assessment task

Assignment: Game Prototype Overview For this assessment task you are expected to construct a prototype level/area as a "proof of concept" for the game that you have designed in Assignment 1. The prototype should function ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As