GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes Strange doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Strange doubt" Watch "Strange doubt" New topic
Author

Strange doubt

Gowrishankar Subramanian
Greenhorn

Joined: Dec 17, 2008
Posts: 5
Hi,
This may sound numb but I terribly need a solution for this.
I've written an abstract class (say ABC.java) and an implementation code for it (say ABCImpl.java).

Now that in some other java class(Main.java), I'm using using an object of type ABC. But how to debug into methods of implementation part ABCImpl.java) when I wish to do so.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18874
    
  40

Now that in some other java class(Main.java), I'm using using an object of type ABC. But how to debug into methods of implementation part ABCImpl.java) when I wish to do so.


Well, you can use a debugger. For somewhat small applications, within a single JVM, the standard debugger with most IDEs are fine.

Otherwise, you should consider using logging (or just sysouts) to keep track of what is going on.


Personally, I recommend doing both. If possible, write small testing classes, which can be used to debug individual components. While use logging when you want to test the whole (large) application.

Henry
[ December 17, 2008: Message edited by: Henry Wong ]

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Gowrishankar Subramanian
Greenhorn

Joined: Dec 17, 2008
Posts: 5
Henry, Thanks for the speedy reply.

The problem is neither the debugger nor the Sysouts work. I can't use a logger as of now for some internal reasons.

When I use debugger, I couldn't step onto the lines in the implemented code. All I can see is some blank white window. I should also make a point that, I use spring configurations for declaring, defining and creating objects on the fly.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18874
    
  40

I should also make a point that, I use spring configurations for declaring, defining and creating objects on the fly.


Yea, spring does add a level of indirection that makes it harder to debug. But why won't sysout work? You can sysout to a file, if the stdout had been routed.

Henry
Gowrishankar Subramanian
Greenhorn

Joined: Dec 17, 2008
Posts: 5
Writing to a file was a great idea!! Why did I miss that one?

Thanks a lot, Henry
 
GeeCON Prague 2014
 
subject: Strange doubt