Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Changing System.out.println()

807580Aug 12 2010 — edited Aug 13 2010
Imagine having hundreds of java classes. In these classes there are many System.out.println(data) in different places. When printing in the console screen I cannot know which java class is printing. Of course I could open every java-file and in every System.out.println() write as:
System.out.println("This is TheNameOfJavaClass" + myData) 
or
System.out.println(this.getClass().getName() + " - " + myData)
...but I want a nice approach like extending or implenting some how in classes and the java classes add java-class-name when using System.out.println(myData) it becomes className + myData

Do you have any suggestion? Is there clever approach to this?

Edited by: Maria1990 on Aug 12, 2010 12:32 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 10 2010
Added on Aug 12 2010
14 comments
326 views