Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

help on generics

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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 learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

886 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