• Post Reply Bookmark Topic Watch Topic
  • New Topic

Logging using class names from java.lang.Reflect...?  RSS feed

Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to find a way of reading class names from the java.lang.Reflect package, to the java.util.logging package, thus reflecting on the class to read the names, and, write the output to a FileHandler of some sort...

This is junk code, it won't compile...

Compile error
C:\Documents and Settings\Jon\workspace\JavaDev\corejava8\v1ch11\LogpTest\LogpTest.java:24: incompatible types
found : java.lang.Class<capture#145 of ?>
required: java.lang.Class<LogpTest>
cl = Class.forName(this.toString());
C:\Documents and Settings\Jon\workspace\JavaDev\corejava8\v1ch11\LogpTest\LogpTest.java:27: Class() has private access in java.lang.Class
protected Class<LogpTest> cl = new Class<LogpTest>();
2 errors

Tool completed with exit code 1

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!