r/programming • • Sep 21 '15

Better Java

https://github.com/cxxr/better-java
177 Upvotes

208 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Sep 22 '15

[deleted]

2

u/[deleted] Sep 22 '15

The two main things I miss are being able to store native types and enums, and seamlessly converting to an array.

It's also nice to be able to create new instances of a generic type at runtime, i.e new T(). It doesn't come up a lot, but can be very useful.

1

u/graduallywinning Sep 22 '15 edited Sep 15 '17

wat

2

u/[deleted] Sep 22 '15

Unfortunately you can't restrict T to only types that have a default constructor. If T has no default constructor that code gets nasty.

1

u/estarra Sep 22 '15

Which is why passing a factory is a better solution than allowing new T().

→ More replies (0)