Hidden features of java

L

Linuxmank

Dear Member,

I have written a post about hidden feature of java on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

I will highly thankfull to you if you contribute to the post by
provide in feature you might now in java that you think can be
"hidden".
Link of the post is mentioned below

Link to the post : http://thegeekhead.blogspot.com/2009/06/hidden-features-of-java.html


Many Thanks
 
M

Mayeul

Linuxmank said:
Dear Member,

I have written a post about hidden feature of java on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

I will highly thankfull to you if you contribute to the post by
provide in feature you might now in java that you think can be
"hidden".
Link of the post is mentioned below

Link to the post : http://thegeekhead.blogspot.com/2009/06/hidden-features-of-java.html


Many Thanks

This looks more like a 'Hey, did you know you can do that in Java?'
collection, than 'hidden' features in my eyes.

I guess it is still useful to the beginner, who might experiment with
what he didn't know yet and be better prepared to make use of it in
relevant cases.

Not too sure how to decide a feature or anything is 'hidden'-class,
though. Did you know the 'Collections' class holds lots of static
utility methods to manipulate collections ? Like Collections.sort()
methods will sort a List you pass to it.
 
L

Lew

There are no "members" here.
I have written a post about hidden feature of java [sic] on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

I will highly thankfull to you if you contribute to the post by
provide in feature you might now in java [sic] that you think can be
"hidden".
Link of the post is mentioned below

Link to the post :
http://thegeekhead.blogspam.scam/2009/06/hidden-features-of-java.html

No features of Java are hidden.
 
D

Dirk Bruere at NeoPax

Lew said:
There are no "members" here.
I have written a post about hidden feature of java [sic] on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

I will highly thankfull to you if you contribute to the post by
provide in feature you might now in java [sic] that you think can be
"hidden".
Link of the post is mentioned below

Link to the post :
http://thegeekhead.blogspam.scam/2009/06/hidden-features-of-java.html

No features of Java are hidden.

Just obscure.
I read somewhere that Java has over 4500 classes.
Anyone here used more than 1000?

--
Dirk

http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
 
A

Arved Sandstrom

Dirk said:
Lew said:
Linuxmank said:
Dear Member,

There are no "members" here.
I have written a post about hidden feature of java [sic] on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

I will highly thankfull to you if you contribute to the post by
provide in feature you might now in java [sic] that you think can be
"hidden".
Link of the post is mentioned below

Link to the post :
http://thegeekhead.blogspam.scam/2009/06/hidden-features-of-java.html

No features of Java are hidden.

Just obscure.
I read somewhere that Java has over 4500 classes.
Anyone here used more than 1000?
Directly used, out of "standard" APIs like J2SE and J2EE? I'm over the
10-year mark for using Java (obviously not by much :)) and I doubt that
I've even come close to 1000. On a month-to-month basis on any given
J2SE/Java EE project there's probably no more than fifty or so standard
classes involved that I use directly, and only a small percentage of the
methods they provide.

AHS
 
R

Roedy Green

I have written a post about hidden feature of java on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

"hidden" is not quite the right word. I had heard of all your
examples. They are all documented. Perhaps the phrase "lesser known"
or "advanced" would be more accurate.

I did a lecture once on Java "gotchas" or surprises. Some
participants were quite angry with me for mentioning gotchas THEY
already knew about. I hoped to avoid that problem by ordering the
them obvious to esoteric with an explanation that was what I was
doing.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Deer hunting would be fine sport, if only the deer had guns."
~ William S. Gilbert of Gilbert and Sullivan
 
L

Lord Zoltar

Dear Member,

I have written a post about hidden feature of java on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

I will highly thankfull to you if you contribute to the post by
provide in feature you might now in java that you think can be
"hidden".
Link of the post is mentioned below

Link to the post :  http://thegeekhead.blogspot.com/2009/06/hidden-features-of-java.html

Many Thanks

I heard that if you say James Gosling's name 3 time backwards in front
of a Java compiler, he'll appear before you and grant you a wish.
 
L

Lew

Arved said:
Directly used, out of "standard" APIs like J2SE and J2EE? I'm over the
10-year mark for using Java (obviously not by much :)) and I doubt that
I've even come close to 1000. On a month-to-month basis on any given
J2SE/Java EE project there's probably no more than fifty or so standard
classes involved that I use directly, and only a small percentage of the
methods they provide.

A more meaningful metric than how many classes a single programmer
used would be how many programmers used a particular class. Either
way, it's a specious argument.

If some programmer by chance has never used, say, any classes from
java.util.concurrent, does that mean that the package shouldn't exist?

I wager that only a handful of programmers have used
java.lang.SecurityManager, yet it would be very difficult to make a
case that it should be removed from the API.

APIs aren't there for popularity - they're there because a solid
implementation is sometimes (or perhaps frequently) needed, and it's
good to have a reliable one in the standard API for those (perhaps
infrequent) times when one absolutely must have it.

A similar argument applies even to language features. Look how long
it's taking people to warm to generics, or even 'assert', which has
been here since 1.4, yet both are extremely useful and arguably
mandatory.

As for APIs, you may never yet have used
java.util.concurrent.CopyOnWriteArrayList<E>, but if and when you need
that functionality you will be mighty glad that the API already has
it. Another meaningful question is how many Java programs out there
have custom implementations of classes that already existed in the API
when they were written, only the programmer didn't know it?
 
T

Tom Anderson

Linuxmank said:
I have written a post about hidden feature of java [sic] on my blog. I
am not a super programmer but yes tried to compile come list of hidden
feature or you can feature not known by most of the people.

I will highly thankfull to you if you contribute to the post by
provide in feature you might now in java [sic] that you think can be
"hidden". Link of the post is mentioned below

Link to the post :
http://thegeekhead.blogspam.scam/2009/06/hidden-features-of-java.html

No features of Java are hidden.

sun.misc.Unsafe?

tom
 
R

Roedy Green

sun.misc.Unsafe?

There are undocumented features. the sun.* packages. However, Dion
Gillard was able to figure out how much of it worked and presented a
paper on them back in the 90s.

Java's design makes it hard to keep many secrets.
--
Roedy Green Canadian Mind Products
http://mindprod.com

"Deer hunting would be fine sport, if only the deer had guns."
~ William S. Gilbert of Gilbert and Sullivan
 
A

Arved Sandstrom

Lew said:
A more meaningful metric than how many classes a single programmer
used would be how many programmers used a particular class. Either
way, it's a specious argument.

If some programmer by chance has never used, say, any classes from
java.util.concurrent, does that mean that the package shouldn't exist?

I wager that only a handful of programmers have used
java.lang.SecurityManager, yet it would be very difficult to make a
case that it should be removed from the API.

APIs aren't there for popularity - they're there because a solid
implementation is sometimes (or perhaps frequently) needed, and it's
good to have a reliable one in the standard API for those (perhaps
infrequent) times when one absolutely must have it.

A similar argument applies even to language features. Look how long
it's taking people to warm to generics, or even 'assert', which has
been here since 1.4, yet both are extremely useful and arguably
mandatory.

As for APIs, you may never yet have used
java.util.concurrent.CopyOnWriteArrayList<E>, but if and when you need
that functionality you will be mighty glad that the API already has
it. Another meaningful question is how many Java programs out there
have custom implementations of classes that already existed in the API
when they were written, only the programmer didn't know it?

I agree with everything you said. The fact that I answered the specific
question doesn't mean I considered it to be a useful metric.

The last question you posed is the best one. .NET has the same problem.
In fact, so does any language with a significant set of libraries (I
find myself continually re-inventing the wheel while experimenting with
GHC Haskell). With something as mature as Java I assume that something
has already been written to do a certain thing, and do a bit of
Googling...it's surprising how often this succeeds.

AHS
 
J

Joshua Cranmer

Linuxmank said:
I have written a post about hidden feature of java on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

Quite frankly, all of these I have used at some point in time.

Covariant return types were introduced to help cope with generics.

Any statement can be labeled, although non-block labeled statements are
rather pointless, since break and continue can only use labels of
enclosing statements.

The constructors and methods of enums are actually described in the enum
feature tutorial, so it's no more hidden than enum.

The last two are probably rather heavily used. Especially the last one,
which I've seen recommended on a regular basis.
 
T

Tom Anderson

There are undocumented features. the sun.* packages. However, Dion
Gillard was able to figure out how much of it worked and presented a
paper on them back in the 90s.

Java's design makes it hard to keep many secrets.

True. But since they're not documented or advertised, i'd call them
hidden, even if they aren't secret.

tom
 
J

John B. Matthews

Tom Anderson said:
True. But since they're not documented or advertised, i'd call them
hidden, even if they aren't secret.

I dared to import sun.misc.Unsafe; rolling over the
NetBeans exclamatory alert displayed this ominous tool-tip,
"Import From Forbidden Package." I can't deny being warned!
 
L

Lew

Thomas said:
I just tried. My cat appeared and jumped on the keyboard. Maybe
Gosling is telling me that my true wish is to pet my cat.

Or your cat is wishing it could munch on a gosling.
 
A

Arne Vajhøj

Dirk said:
Lew said:
Linuxmank said:
Dear Member,

There are no "members" here.
I have written a post about hidden feature of java [sic] on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

I will highly thankfull to you if you contribute to the post by
provide in feature you might now in java [sic] that you think can be
"hidden".
Link of the post is mentioned below

Link to the post :
http://thegeekhead.blogspam.scam/2009/06/hidden-features-of-java.html

No features of Java are hidden.

Just obscure.
I read somewhere that Java has over 4500 classes.
Anyone here used more than 1000?

Counting public in java.* and javax.* in Java 6 I have counted
3288 classes with 97480 methods !

I don't know how many of them I have used.

Arne
 
A

Arne Vajhøj

Tom said:
Linuxmank said:
I have written a post about hidden feature of java [sic] on my blog.
I am not a super programmer but yes tried to compile come list of
hidden feature or you can feature not known by most of the people.

I will highly thankfull to you if you contribute to the post by
provide in feature you might now in java [sic] that you think can be
"hidden". Link of the post is mentioned below

Link to the post :
http://thegeekhead.blogspam.scam/2009/06/hidden-features-of-java.html

No features of Java are hidden.

sun.misc.Unsafe?

Depends on what is meant by "Java".

If Java == the Java standard, then it is indeed hard to talk about
hidden features and sun.* classes are not part of Java.

If Java == SUN's Java implementation, then there are lots
of stuff that is not documented.

Arne
 
A

Arne Vajhøj

Lew said:
I wager that only a handful of programmers have used
java.lang.SecurityManager, yet it would be very difficult to make a
case that it should be removed from the API.

If you include those that have used java.rmi.RMISecurityManager,
then you will need some pretty big hands.

Arne
 
L

Lew

Arne said:
If you include those that have used java.rmi.RMISecurityManager,
then you will need some pretty big hands.

True, once, but I'll bet a nawful lot of Java folks haven't been (explicitly)
playing with RMI lately. Besides, I didn't include those.

Anyway, the point is that APIs contain fundamental classes and methods, not
necessarily widely-popular ones. The problem isn't whether the API is too
big, but whether it's big enough.
 

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

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,270
Latest member
TopCryptoTwitterChannels_

Latest Threads

Top