Java collection program showing error - Stack is abstract, cannot be instantiated -


import java.util.*;  public class stackdemo {     public static void main (string[] args)     {         stack st = new stack();     } } 

while running code on jcreator jdk 1.6 error occured -

stack abstract; cannot instantiated stack st = new stack();

otherwise program runs on online compilers http://www.compileonline.com/

please help.

try do:

java.util.stack st = new java.util.stack(); 

you have abstract class called stack in project.

note stack raw type, don't forget infer generic type arguments.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -