java variable to variables code example
Example 1: variable name in java
Java variable names are case sensitive. ...
Java variable names must start with a letter, or the $ or _ character.
After the first character in a Java variable name, the name can also contain numbers (in addition to letters, the $, and the _ character).
Example 2: Variables in java
public class LocalVariableExample
{
public void employeeDetails()
{
int empAge = 22;
String name = "Sachin";
}
public static void main(String[] args)
{
LocalVariableExample obj = new LocalVariableExample();
System.out.println("Employee name is : " + name + ", and age : " + empAge);
}
}