0
How to add variable
I want to be a apps developers
2 Respostas
0
Syntax for creating a variable in Java :-
Syntax :- datatype var_name = value;
Ex :- int a = 10;
0
To create a simple local variable, for example a int or string use:
int number = 50;
string word = "word";
static void PrintMyVariable(){
int number = 10;
string type = "dogs";
System.out.println("Peter has "+number+" "+type);
}
this would print: Peter has 10 dogs