Lesson 25 of 34
Classes மற்றும் ObjectsClasses and Objects
10 min 30 XP
Java ஒரு object-oriented மொழி. Class ஒரு வரைபடம் (blueprint): அதில் fields (தரவு) மற்றும் methods (செயல்கள்) இருக்கும். new மூலம் அந்த class-லிருந்து objects உருவாக்குகிறோம். ஒவ்வொரு object-க்கும் தனி மதிப்புகள்.
Java is object-oriented. A class is a blueprint with fields (data) and methods (actions). We create objects from it with new, and each object has its own values.
Example: edit me and press Run
Press Run to see the result here.ஒரு file-ல் ஒரே ஒரு public class மட்டும் இருக்கலாம். மற்ற classes-ஐ public இல்லாமல் Main-க்கு மேலே எழுதுங்கள்.
A file can have only one public class. Write your other classes above Main without the word public.