• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 264
  • Last Modified:

help on generics

Hi,
    I wrote a class BinaryTreeNode<T> and tried to use it in this declaration: public static int depth(BinaryTreeNode<T> r) {...}  . I got this error:
 cannot find symbol
symbol  : class T
location: class TreeConvert
   public static int depth(BinaryTreeNode<T> r)

why is that? please help . thanks
0
azcalv408
Asked:
azcalv408
1 Solution
 
shinobunCommented:
You should define your class TreeConvert<T>.

http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now