• Post Reply Bookmark Topic Watch Topic
  • New Topic

Change in basic java output  RSS feed

 
rajnish patel
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am beginner in java. I want someone to help me with little doubt..
Here is my code. and output. Now I get my output as only package name i.e. util.hashmap


So what should i do, I searched a lot but couldn't find anything....
Waiting for kind reply.
Thank you.





OUTPUT
class java.util.HashMap
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rajnish patel wrote:OUTPUT
class java.util.HashMap

That's correct. Why do you think there's a problem? What were you expecting?
 
rajnish patel
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
rajnish patel wrote:OUTPUT
class java.util.HashMap

That's correct. Why do you think there's a problem? What were you expecting?


I know sir that it it correct but I am learning basic things and I want only package name i.e. util.hashmap
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the javadoc for a suitable method?
 
rajnish patel
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Have you checked the javadoc for a suitable method?



yes sir, but it couldn't help me....
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then you did not look closely enough. Carefully look through the javadoc for java.lang.Class.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Also, util.HashMap isn't the package name. The package name is java.util. You need to explain what your definition of package name is -- and if it isn't the same as Java's definition, you may need to parse and build it in code yourself.

Henry

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!