0

How do i use temp variable?

31st Aug 2017, 11:00 AM
Zawe
Zawe - avatar
3 Answers
+ 6
int i = 14; // some variable int temp = i; // A variable used only to store something for a short period of time The question is sort of to vague, you use the temp variable the same way you use a variable. Depends on what it's purpose is in the program.
31st Aug 2017, 4:34 PM
Rrestoring faith
Rrestoring faith - avatar
+ 3
int i, j, k; <<declared i,j,k to a data type int i = 2; <<initialized one of the declared variables System.out.println(i);
31st Aug 2017, 12:40 PM
D_Stark
D_Stark - avatar
+ 1
declare a variable, name it temp (or anything else)
31st Aug 2017, 11:05 AM
Salekin
Salekin - avatar