Blog Introductions

In this  blog contains tutorials about  HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials,  Examples, Source code,Learning,
Tips and Software development  services. Java OOP and Object orriented programing |  Java tutorials Bestitworriors.



Java OOP and Object orriented programing

Java tutorials
Java tutorials




Java OOP and Object orriented programing - OOP stands for object orriented programing.In object oriented programing we talk aboout object and its classes.Object define as any thing which have some properties and methods.For exemple a car is an object that have properties like color , height ,width,waight etc and methods like start , stop ,drive etc.Object oriented programing is fast and easier to execute.OOP provide clear structure of code .


  Some Key Points of Java OOP

  1. OOP stands for object orriented programing
  2. Object define as any thing which have some properties and functions
  3. For working on object we use class
  4. Class have some properties like datamembers or variables
  5. Class have some function like methods or class function
  6. Class data member or function start by access specifier
  7. Access specifier is know private , public or protected
  8. Class have constructors
  9. Java OOP support polymorphism , Encapsulation and Inheritance etc
  10. Class have static method also and can be work or run without creating an object just call it.
  11. Static method can be called without creating an object
  12. Public method must be called after creating an object


Code


public


class myclass {
// Static method
int x;

public myclass() {
x = 5;
}
static void myStaticMethod() {
System.out.println("Static methods can be called ");
}

// Public method
public void myPublicMethod() {
System.out.println("Public methods must be called");
}

// Main method
public static void main(String[] args) {
myStaticMethod(); // Call the static method
// myPublicMethod(); This would compile an error

myclass myObj = new myclass(); // Create an object of Main
myObj.myPublicMethod(); // Call the public method on the object
System.out.println(myObj.x);
}
}

OutPut


Static methods can be called
Public methods must be called
5



I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back about Java OOP and Object orriented programing