Programming is conditions and it is the main core of start writing a code as when you think in any problem you will find that you need to take decision for that we have decision making statments as the following: The if-then Statement: An if statement consists of an expression followed by one or more statements. this expression evaluates […]
Variables must be declared before being used. basically the type is one of Java’s datatypes. The identifier is the name of the variable. To declare more than one variable of the specified type, use a comma-separated list.
datatype identifier [ = value][, identifier [= value] ...] ;
Here are several examples of variable declarations of various types. Note that some include an initialization.
int a, b, c; // declares three ints, a, b, and c.
int d = 3, e, f = 5; // declares three more ints, initialising d and f.
byte z = 22; // initializes z.
double pi = 3.14159; // declares an approximation of pi.
char x = 'x'; // the variable x has the value ‘x'.
Usualy when you create a variable you reserve some space in memory Based on its data type, the operating system allocates memory and decides what can be stored in the reserved memory. There are two data types available in Java: Primitive Reference/Object Primitive Data Types: There are eight primitive data types supported by Java. Primitive data types […]
A normal deffinaton of Java program is a collection of objects that communicate by using each other’s methods. And: Object: In language a material thing that can be seen and touched. a person or thing to which a specified action or feeling is directed. in Programming : A lines of codes that have have states/properties and behaviors/methods. also […]
After two years of hard work without a rest and dealing more technologies. I decided to return back to blogging in a weekly bases then I will increase it if I found a reason to do so. But first I will answer some questions might come to your mind while reading this blog post: Q: […]