English

Write about the declaration of Variables in JAVA.

Advertisements

Question

Write about the declaration of Variables in JAVA.

Short Answer
Advertisements

Solution

In Java, declaration of variables refers to the process of specifying the data type and name of a variable before using it in a program. The data type determines the type of value that can be stored in the variable.

Syntax:

dataType variableName;

Example:

int age;

Here, int is the data type and age is the variable name. This statement declares a variable named age that can store integer values.

shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Variables and Expressions - EXERCISE [Page 131]

APPEARS IN

Dheeraj Mehrotra Computer Science [English] Class 12
Chapter 6 Variables and Expressions
EXERCISE | Q 10. | Page 131
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×