Basics
Basic syntax and functions from the Java programming language.
Boilerplate
Showing Output
It will print something to the output console.
Taking Input
It will take string input from the user
Primitive Type Variables
The eight primitives defined in Java are int, byte, short, long, float, double, boolean, and char those aren't considered objects and represent raw values.
byte
byte is a primitive data type it only takes up 8 bits of memory.
long
long is another primitive data type related to integers. long takes up 64 bits of memory.
float
We represent basic fractional numbers in Java using the float type. This is a single-precision decimal number. Which means if we get past six decimal points, this number becomes less precise and more of an estimate.
char
Char is a 16-bit integer representing a Unicode-encoded character.
boolean
The simplest primitive data type is boolean. It can contain only two values: true or false. It stores its value in a single bit.
int
int holds a wide range of non-fractional number values.
short
If we want to save memory and byte is too small, we can use short.
Comments
A comment is the code that is not executed by the compiler, and the programmer uses it to keep track of the code.
Single line comment
Multi-line comment
Constants
Constants are like a variable, except that their value never changes during program execution.
Arithmetic Expressions
These are the collection of literals and arithmetic operators.
Addition
It can be used to add two numbers
Wow, Very nice Blog!!!
ReplyDeleteThank you for sharing your article. Great efforts were put to find the list of articles which is very useful to know. This is a great blog. I am pretty much impressed with your good work." Java CheatSheet | Beginners, Intermediate " you put really very helpful information. Keep it up. A web hosting service that offers Each acting as its own independent server. These servers are used to host websites, applications, and other services. If you want your website host. Get now Norway Dedicated Server Hosting. you can ask us for more details and services.