This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes Names of Class<Throwable[]> objects and Semicolons Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Names of Class<Throwable[]> objects and Semicolons" Watch "Names of Class<Throwable[]> objects and Semicolons" New topic
Author

Names of Class<Throwable[]> objects and Semicolons

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32674
    
    4
I have only just noticed that when I printed out the Throwable[] shown in this post, it didn’t come out as [Ljava.lang.Throwable@abcd1234. It printed [Ljava.lang.Throwable;@abcd1234. I had never noticed the semicolon before. It doesn’t say anything about semicolons in the JLS, nor in Object#toString().
Am I seeing things? Has that semicolon always been there?
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3011
    
    9
Campbell Ritchie wrote:I have only just noticed that when I printed out the Throwable[] shown in this post, it didn’t come out as [Ljava.lang.Throwable@abcd1234. It printed [Ljava.lang.Throwable;@abcd1234. I had never noticed the semicolon before. It doesn’t say anything about semicolons in the JLS, nor in Object#toString().
Am I seeing things? Has that semicolon always been there?

It does mention it in Object#toString(). The part before the @ is what is returned by class.getName() and the semicolon is part of an array's class name. So you will need to find out where that is documented to find out if it's always been there.


Joanne
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32674
    
    4
Thank you Joanne
In Class#getName() it does say L[className; if it is an array. I had always seen the L. I had never noticed the ; before. If you go back to the days when it was Class rather than Class<?>, it says the same.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Names of Class<Throwable[]> objects and Semicolons
 
Similar Threads
When static method does not take part in overriding then why can we declare a throws clause.
try-with-resources from Java tutorial
Loading of Static inner class.
static and non-static methods inheritance
Class loading