- Joined
- Sep 1, 2007
- Sythe Gold
- 690
- Messages
- 6,681
So bare with me, I'm just now learning java, and I literally know nothing about it. I have a homework problem where I'm supposed to program some stupid DJ Name generator
I have this code: http://pastebin.com/cRwrMZNt
And the problem is, if I use Scanner, lines 7 and 10 give an error because non-static variable scan cannot be referenced from a static context. If I use static Scanner, lines 8 and 11 give an error because non-static method substring(int,int) cannot be referenced from a static context. Or something like that, idk
It was probably stupid to try, but I also tried importing both a static and non-static scanner, and that didn't solve the issue...
How do I fix this?
I have this code: http://pastebin.com/cRwrMZNt
And the problem is, if I use Scanner, lines 7 and 10 give an error because non-static variable scan cannot be referenced from a static context. If I use static Scanner, lines 8 and 11 give an error because non-static method substring(int,int) cannot be referenced from a static context. Or something like that, idk
It was probably stupid to try, but I also tried importing both a static and non-static scanner, and that didn't solve the issue...
How do I fix this?







