#poolfactory
Explore tagged Tumblr posts
ipoolgoofficial · 3 days ago
Text
Keep going 🤝🤝
0 notes
jacob-cs · 8 years ago
Link
original source : http://stackoverflow.com/questions/6607550/what-does-angle-brackets-mean-in-java
question
I am currently studying Java and have recently been stumped by what does <> means?
public class Pool<T>{  public interface PoolFactory<T>{  public T createObject(); } this.freeObjects= new ArrayList<T>(maxsize)
What does the <T> mean? Does it means that I can create an object of type T?
answer
<T> is a generic and can usually be read as "of type T". It depends on the type to the left of the <> what it actually means.
I don't know what a Pool or PoolFactory is, but you also mention ArrayList<T>, which is a standard Java class, so I'll talk to that.
Usually, you won't see "T" in there, you'll see another type. So if you see ArrayList<Integer>for example, that means "An ArrayList of Integers." Many classes use generics to constrain the type of the elements in a container, for example. Another example is HashMap<String, Integer>, which means "a map with String keys and Integer values."
Your Pool example is a bit different, because there you are defining a class. So in that case, you are creating a class that somebody else could instantiate with a particular type in place of T. For example, I could create an object of type Pool<String> using your class definition. That would mean two things:
My Pool<String> would have an interface PoolFactory<String> with a createObjectmethod that returns Strings.
Internally, the Pool<String> would contain an ArrayList of Strings.
This is great news, because at another time, I could come along and create a Pool<Integer>which would use the same code, but have Integer wherever you see T in the source.
0 notes
djtoken · 9 years ago
Photo
Tumblr media
Helps clear my head when I can't ride #9ball #poolfactory
0 notes
djtoken · 10 years ago
Photo
Tumblr media
Current situation pool league #8ball #9ball #poolfactory
0 notes