I was watching a Java tutorial on YouTube about variable arithmetic. So I thought I'd make a simple programm to take two variables and do arithmetic on them. So I declare an int variable x. Then this happens:
I hover the mouse and it says "Local variable x is never read". What is this?
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]
[LEFT]public[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]class[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Variable_Arithmetic {
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][/B]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055] public[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]static[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] main(String[] args) {
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][/COLOR][/SIZE][/COLOR][/SIZE][/B]
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055] int[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [U]x[/U] = 10;
}
}[/LEFT]
[/SIZE]
I am using Eclipse for whatever it's worth.
Help would be great.


Sign In
Create Account


Back to top









