?
Solved

help on generics

Posted on 2006-10-22
1
Medium Priority
?
250 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 200 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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 …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month13 days, 4 hours left to enroll

777 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