aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Interesting inner Classes Check inside Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Interesting inner Classes Check inside" Watch "Interesting inner Classes Check inside" New topic
Author

Interesting inner Classes Check inside

Hussain
Ranch Hand

Joined: Nov 22, 2001
Posts: 110
salam(hi) all ranches,
Hope every budy fine and doing Java.
AS i m preparing for the exam i just come to know tht intersting thing.as everybudy Know tht we cant use abstarct and private both I do.
E.g...
class A
{
static private abstarct class B//as inner class can be private
{
}
}
class A
{
class B
{
final static int i=0;//compile as i is a compile time constant
}
}
class A
{
class B
{
final static int i=a();
//won't compile as i is not compile time contant

}
static int a()
{
return 1;
}
}
interesting!
U c the power of Final variables both inside and outside the method
------------------
Muhammad Hussain

Muhammad Hussain<br />Sun Certified Java Programer (SCJP2)<br />Sun Certified Web Component Devloper SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interesting inner Classes Check inside
 
Similar Threads
static inner class
Inner Class
Final Variables are Very PowerFull (Check inside))
Static method inside an inner class.
Inner class