Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Hamish Jones   on Jul 04 In Java Category.

  
Question Answered By: Wilbert Patterson   on Jul 04

What I am trying to do is to have a method  in class  b that will use
the class name of class a. Basically I am writing some kind of a
logger class that will print (for a certain error condition) the type
of the error and the class/method in which was detected; the logger
will be an instance variable of all other classes.
Hope this clarify the issue.
I was thinking about passing the class name as parameter in the
constructor also, but I wanted to know if it is a different way to do
it (i.e. access from class b the class name of the container  class).

Share: 

 

This Question has 7 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on get reference to container class Or get search suggestion and latest updates.


Tagged: