Who says you can't? Of course you can do exactly as you described. Unless you're in a class and the teacher tells you one way will get a good grade and another way will get a bad grade. Do the way...
Type: Posts; User: GregBrannon
Who says you can't? Of course you can do exactly as you described. Unless you're in a class and the teacher tells you one way will get a good grade and another way will get a bad grade. Do the way...
Or you could do as you've suggested, and I don't think there's anything wrong with it other than it may be more complicated than it needs to be:
class Outer
{
private int temp=9;
class...