Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.96 KB

README.md

File metadata and controls

65 lines (43 loc) · 1.96 KB

INTRODUCTION TO JAVA

A repository that contains all info about what I have learnt in java.

In this repository, you can find all my lessons in java and I hope it turns out to be helpful for beginners trying to step into the "java world" :)

JAVA is an object-oriented, cross platform, multi-purpose programming language produced by Sun Microsystems. One thing that distinguished Java from some other languages is its ability to run the same compiled code across multiple operating systems. Java's creators tried to design it so code could be written efficiently and easily. Writing, compiling and debugging a program is easy in java. It helps to create modular programs and reusable code.

DATA TYPES IN JAVA

Primitive data types: In java, there are eight primitive data types, namely boolean, char, byte, short, int, long, float and double. Byte can hold whole numbers between -128 and 127, while the range of short is -32,768 to 32767, long is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Float holds upto 7 decimal digits, double upto 15 decimal digits, cahr holds a character and boolean holds a true or false value.

OPERATORS IN JAVA

An operator performs certain actions. The types of operators used in java are: 1) Basic Arithmetic Operators 2) Assignment Operators 3) Auto-increment and Auto-decrement Operators 4) Logical Operators 5) Comparison (relational) operators 6) Bitwise Operators 7) Ternary Operator

OPERATOR PRECEDENCE IN JAVA

Unary Operators ++ – – ! ~

Multiplicative

  • / %

Additive

Shift << >> >>>

Relational

= < <=

Equality == !=

Bitwise AND &

Bitwise XOR ^

Bitwise OR |

Logical AND &&

Logical OR ||

Ternary ?:

Assignment = += -= *= /= %= > >= < <= &= ^= |=