java - The type Stack is not generic; it cannot be parameterized with arguments <Character> -
i trying write simple program use stacks.it giving me error
the type stack not generic; cannot parameterized arguments
import java.util.*; public class stack { public static void main(string[] args) { stack<character> stack = new stack<> (); s.push("hello"); system.out.println(s); } }
your class stack
shadowing java.util.stack
. rename class, or use qualified class name like
java.util.stack<character> stack = new java.util.stack<> ();