Hello,

java noob here, in the code below, why is it when declaring a class that '<E>' is used in stead of the brackets ? '(E)'??

public class LLStack**<E>** implements Stack<E>{
 private Node**<E> **head ;
 public LLStack ( ){ head = nul l ;} //creates an empty stack
 public boolean isEmpty ( ){ . . . }
 public E top ( ) throws EmptyStackException{ . . . }
 public void push (E e){ . . . }
 public E pop ( ) throws EmptyStackException{ . . . }

Thanks in advance!!!!

These are called Generic,
It enable the programmers single (Class or method ) declaration, a set of related types
for more check the link

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.