چند نکته در مورد Object و Method در جاوا

  • Object is an instance of a class.
  • Instance is a memory location at RAM that created dynamically at run time.
  • Object is a memory location in the RAM reserved dynamically for the members of the class.
  • we can create an object by providing/using a "new" keyword with constructor.
  • After creation of object we need to store the memory location and the address of that memory location. by creating a reference variable we can store the address of that object. example: Demo d1 = new Demo();
  • whenever we create the object, it creates a new copy of non static variables in those instances. These variables change from one instance to another instance and they are known as instance variables.
  • Java loads signature of method in RAM when we call a method and also load signature of methods from library which we use in program


نکاتی در مورد Class در جاوا

  • Class is a user defined data type that contains variables and the methods.
  • Class is a blueprint of an object
  • To declare a class we are using a keyword class and it is followed by the class name
  • The first capital of a class name should be A-z it is conventional it has not compile error
  • Letters of the class name can be a-z , A-Z, 0-9, _ , $

example: class Demo, class MyProject, ...

چه زبانی از زبان های برنامه نویسی 100% شی گرا است؟

class, object, inheritance, Polymorphism, Data Abstraction, Encapsulation are OO properties. each language who support all of them is 100% OO language.

C++ is not a 100% OO language but Java is a 100% Object Oriented Language.

رابطه بین Platform Independency و class. فایل و JVM در جاوا

How platform independency can be achieved in java? The platform independency can be achieved using the .class file and JVM(Java Virtual Machine)

تعریف Platform Independency

  • Java is a platform independent programming language.
  • What is "platform independency"? The compilated code of one program which is capable to execute on any platform.