VOOZH about

URL: https://www.javacodegeeks.com/2016/05/go-language-java-developer-part-6-operators.html

⇱ Go Language For Java Developer Part-6 : Operators - Java Code Geeks


Operators in Java and Go Lang.  Every programming languages support operators. Operators are work like a function with different syntax compared to normal function. For example arithmetic operator +.

List of Operators in Java & Go Lang

The Following table has a list of operators available in the language.
 
 
 
 

SrOperatorDescriptionGoJava
1+additionYesYes
2subtractionYesYes
3*multiplicationYesYes
4/quotientYesYes
5%remainderYesYes
6&bitwise andYesYes
7|bitwise orYesYes
8^bitwise xorYesYes
9~bitwise complimentYes
10&^bit clear (and not)Yes
11<<left shiftYesYes
12>>right shiftYesYes
13>>>zero fill right shiftYes
14++IncrementYes
15DecrementYes
16=equalYesYes
17==equal toYes
18!=not equalYesYes
19<less thanYesYes
20<=less than or equalYesYes
21>greater thanYesYes
22>=greater than or equalYesYes
23&&logical andYesYes
24||logical orYesYes
25!logical notYesYes
26&address of / create pointerYes
27*dereference pointerYes
28<-send / receive operator (see ‘Channels’ below)Yes
29+=assignment OperatorsYes
30-=assignment OperatorsYes
31*=assignment OperatorsYes
32/=assignment OperatorsYes
33%=assignment OperatorsYes
34<<=assignment OperatorsYes
35>>=assignment OperatorsYes
36&=assignment OperatorsYes
37^=assignment OperatorsYes
38|=assignment OperatorsYes
39?:conditional operatorYes

Go language doesn’t have assignment operator (+=) but Go lang has & operator which works as bitwise operator and address of the pointer. Go lang has bit clear &^ operator while Java has bit shift operators.

Reference:

1. Go Lang: https://golang.org/ref/spec#Operators

2. Java Language: https://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.12

Reference: Go Language For Java Developer Part-6 : Operators from our JCG partner Ketan Parmar at the KP Bird blog.
Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

Tags
Go
👁 Photo of Ketan Parmar
Ketan Parmar
May 9th, 2016Last Updated: May 8th, 2016
0 96 1 minute read

Ketan Parmar

Ketan Parmar (aka KPBird) is software engineer with 7 years experience, He is passionate about Java (SE,EE,ME),Android,BlackBerry, Grid Computing, Big Data, UI/UX and Open Source
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Back to top button
Close
wpDiscuz