Changes 9/10/14
Java:
- Set up my JDK and IntelliJ Idea, which is the IDE I will be using
- Wrote a simple class to test out how Java handles a class like public class ExampleClass<T> {}
- Essentially I can then replace T with whatever I want when defining a new instance of ExampleClass, like new ExampleClass<String> or new ExampleClass<Integer> (you can't use primitive data types like int or float, though)
- Then, any time you put a T in the class definition, it will be replaced with whatever the data type is, so with the statement public T exampleVariable;, exampleVariable would be of type String in the first case and of type Integer in the second. This is pretty cool, and was not something I really understood before.
No comments:
Post a Comment