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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
Generics Syntax
Dishi Jain
Ranch Hand
Posts: 46
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
class Test1<String> { String my; public Test1(String my) { this.my = my; } public String get() { return my; } } public class RunTest { public static void main(String[] args) { Integer i = new Test1<Integer>(1).get(); System.out.println(i.getClass()); } }
What is that syntax at line number 12.
Test1<Integer>(1)
Martin Vanyavchich
Ranch Hand
Posts: 241
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It's an instantiation of a generic class. Try reading this, it might help:
http://download.oracle.com/javase/tutorial/java/generics/index.html
SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Yeah. What he said. Totally. Wait. What? Sorry, I was looking at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Mock Exam Qn.(What is the result)
Constructor
StackOverflowError
Generics/wildcards in variable declaration
doubt
More...