Solved

help on generics

Posted on 2006-10-22
1
239 Views
Last Modified: 2010-03-31
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
Comment
Question by:azcalv408
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 9

Accepted Solution

by:
shinobun earned 50 total points
ID: 17785671
You should define your class TreeConvert<T>.

http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question