Q.8. What is the syntax for initializing a variable in Java?
data_type variable_name = initial_value;
Q.8. What is the syntax for initializing a variable in Java? Read More »
data_type variable_name = initial_value;
Q.8. What is the syntax for initializing a variable in Java? Read More »
The purpose of initializing a variable in Java is to assign it an initial value so that it can be safely used in program . By initializing a variable, it prevents runtime exceptions , avoid compilation errors and enhance safety & security.
Q.7.What is the purpose of initializing a variable in Java? Read More »
In Java primitive data type store the actual value directly , while reference data type store a memory address that points to where the actual data is located .The size of the primitive variable is fixed whereas the size of reference variable is dynamic
Variables in Java are used to allocate specific amount of memory for the data and to inform the compiler about the type of data that will be stored.
Q.3. What is the main purpose of declaring variable in Java? Read More »
The two main categories of data types in java are primitive data type and reference data type.
Q.2.What are the two main categories of data types in java? Read More »
Data type in java defines the type and size of data a variable can store.
Q.1.What is data type in Java? Read More »