Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Ron McLeod
Paul Clapham
Tim Cooke
Devaka Cooray
Sheriffs:
Liutauras Vilda
paul wheaton
Rob Spoor
Saloon Keepers:
Tim Moores
Stephan van Hulst
Tim Holloway
Piet Souris
Mikalai Zaikin
Bartenders:
Carey Brown
Roland Mueller
Forum:
Programmer Certification (OCPJP)
Generic question
Shawn Kuenzler
Ranch Hand
Posts: 73
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
How come line 4 is syntactically wrong?
class Food{} class Fruit extends Food{} class Apple extends Fruit{} class Pie<T super Apple>{ public static void main(String[] args){ Pie<Fruit> p = new Pie<Fruit>(); } }
SCJP 1.5
Melle Lee
Greenhorn
Posts: 12
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
A type variable for a generic class declaration use only the keyword "extends".
But the parameterized type can use both keywords "super" and "extends".
Amarender Reddy
Ranch Hand
Posts: 54
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
can anyone give more explanation on this plz!!
cheers
She's brilliant. She can see what can be and is not limited to what is. And she knows this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Use of generic term super in class declaration
Why the answer is... MasterExam
Generic question from Master Exam
Generics ques...pl help explain
Generic class type declaration
More...