" நிலையான முறைகளுக்கு கூடுதலாக, நிலையான வகுப்புகள் உள்ளன. இவற்றைப் பற்றி பின்னர் விரிவாகப் பேசுவோம். இப்போதைக்கு, நான் உங்களுக்கு ஒரு உதாரணத்தைக் காட்டுகிறேன்:"

உதாரணமாக:
public class StaticClassExample
{
    private static int catCount = 0;

    public static void main(String[] args) throws Exception
    {
        Cat bella = new Cat("Bella");
        Cat tiger = new Cat("Tiger");

        System.out.println("Cat count " + catCount);
    }

     public static class Cat
    {
        private String name;

        public Cat(String name)
         {
            this.name = name;
            StaticClassExample.catCount++;
         }
     }

}
2
பணி
Java Syntax,  நிலை 6பாடம் 7
பூட்டப்பட்டது
Code entry
Your attention, please! Now recruiting code entry personnel for CodeGym. So turn up your focus, let your fingers relax, read the code, and then... type it into the appropriate box. Code entry is far from a useless exercise, though it might seem so at first glance: it allows a beginner to get used to and remember syntax (modern IDEs seldom make this possible).

" நீங்கள் எத்தனை கேட் பொருட்களை வேண்டுமானாலும் உருவாக்கலாம். ஆனால் நிலையான மாறியில் இது இல்லை. நிலையான மாறியின் ஒரே ஒரு நகல் மட்டுமே உள்ளது."

"வகுப்பு அறிவிப்பில் நிலையான மாற்றியைப் பயன்படுத்துவதன் முக்கிய நோக்கம் Cat மற்றும் StaticClassExample வகுப்புகளுக்கு இடையிலான உறவைக் கட்டுப்படுத்துவதாகும் . யோசனை தோராயமாக இதுதான்: Cat class ஆனது StaticClassExample பொருள்களுடன் இணைக்கப்படவில்லை மற்றும் நிகழ்வை அணுக முடியாது (அல்லாத நிலையான) StaticClassExample வகுப்பின் மாறிகள்."

"எனவே நான் வகுப்புகளுக்குள் வகுப்புகளை உருவாக்க முடியுமா?"

"ஆம். ஜாவா அதை அனுமதிக்கிறது, ஆனால் இப்போது அதைப் பற்றி அதிகம் சிந்திக்க வேண்டாம். எதிர்காலத்தில் இன்னும் சில விஷயங்களை நான் உங்களுக்கு விளக்கும்போது அது தெளிவாகிவிடும்."

"நான் நம்புகிறேன், ரிஷி."