why this little piece of code is giving illegal start of type error in line 6 and 10(for loops).... i can\'t find any unmatched braces...
class StackDemo{
You can't use for loop in class level. Put them inside a method or a block
for
method
block
Also java.util.Stack in Java don't have such constructor.
java.util.Stack
Java
It should be
Stack s = new Stack()
Another issue
s.push(char('A'+i))// you will get Unexpected Token error here
Just change it to
s.push('A'+i);