a simple question

S

Shawn

Hi,

I am reading some Java file, which I don't understand:

Class A<B> {
B b;
A(B b) {this.b = b;}
....
} //A

A<JComponent> = new A(JButton);


I have never seen <..> after a Class name, like Class A<B>. I guess this
is some template stuff, similar to C++. Is this something new for Java
1.5 or I just didn't know before?

Thank you.
 
T

Tim Ward

Shawn said:
I have never seen <..> after a Class name, like Class A<B>. I guess this
is some template stuff, similar to C++. Is this something new for Java
1.5

Yes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,076
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top