OOP (Object Oriented Programming) In English.

                            

                        Object Oriented Programming (OOP)




           Content

               1.Standards of OOP

                    2.What is object?

                    3.What is class?

                    4.What is variable?

                    5.What is method?

                    6.Object generating

1.Standards of OOP

      Standards in class

           When applying a name to a class, an uppercase letter is usually used for its                              first letter. This makes it easy to distinguish the class from variables and                                    methods.  

                  Ex: - 

                       public class Computer {  

                         int x = 3;

                                        

       When using two words for the name of the class, they are used together                                     without space and the first word is used in lowercase letters, the first letter of the                       second word is used in uppercase letters and the remaining letters are used in                         lowercase letters. This is called camel case.

                               Ex: -

                                    public class myComputer {

                                      int x = 3;

                                      }

          Standards in variable  

          Lowercase letters should be used when naming variables. Names with two words                     are separated by underscores.

                                Ex: -

                                      public class Computer {

                                        model = "Mahindra"

                                        car_color = "black"

                                       }

      

          Standards in Method 

         When creating a method, it is mandatory to add ( ) after its name. This is called a                      parameter.

                                Ex: -

                                      class Java {

                                      public void test () {

                                         }

                                      }


                                   
        

                                               

                  •  - Dot operator

                 - Assign

               == - Equal

                          

   The following words cannot be used while naming classes, variables, methods and                   these are called keywords.

                                

abstractcontinuefornewswitch
assertdefaultgotopackagesynchronized
booleandoifprivatethis
breakdoubleimplementsprotectedthrow
byteelseimportpublicthrows
caseenuminstanceofreturntrasient
catchextendsintshorttry
charfinalinterfacestaticvoid
classfinallylongstrictfpvolatile
constfloatnativesuperwhile



 2.What is object?

    Anything that has properties and behaviors can be called an object.

                       Ex: - Human

                                                            





PropertiesBehaviors
handsswim, write
legsrun, walk
moutheat, drink
earslisten

  

 3.What is class?

    The template we create for an object can be called a class.

                     Ex: - class Human

  

PropertiesBehaviors
Hands – 0,1,2Swim – yes/no
Legs – 0,1,2Run - speed
Mouth – 1,0Eat - rice

  Here you can use the template's properties and behaviors by changing their                              values. No need to create objects repeatedly.

 

  4.What is variable?

        Variables can be used to hold the properties of the object inside the class.


  5.What is method?

        Methods can be used to hold the behaviors of the object inside the class.






  6.Object generating

   We can create more objects from the class and perform the required task by                             changing the values of those objects.








                     

Comments

Popular posts from this blog

Lambda expression in Java. In English

Loops in Java. In English

Conditions in java. In English