Programming Shortcut

Write, Run and execute Your programs with simple and esay way by Programming Shortcut

Wednesday, May 29, 2019

Object-Oriented Programming (OOP) in Java

What is Object Oriented Programming?

Object-Oriented Programming is a programming process, That process work on the principle
of class and object. Object-Oriented Programming is provided a structural way programming techniques that work is optimized code and time effort and increase code re-usability of your programming.

In the Java oops concepts use following :

1.Object
2.Class
3.Inheritance
4.Polymorphism
5.Abstraction
6.Encapsulation

What is Object?

 An object is a real-world entity like a book, table, chair etc. In the term of programming, the object is
 is a method, a function, an entity of the class.
 What is a class?
 A class is set a set of Object or collection of the object and also class is a blueprint of all method(Object).

 Example: A book is a class then there book common object is "book={ title, book_type, page_no, author } ".
Here title is what the title is of the book, book_type What type of book is like Novel, biography or textbook(in math, science, English, programming), page_no is how many page no in the book, and an author is who writes the book.

 public class book{  // Main Class of java programming
String title;
String book_type;
int page_no;
String auther;
public static void main(String[], args){  // Main Function of java programming
book b=new book();
b.title=Java: The Complete Reference;
b.book_type =textbook;
b.page_no=1344 ;
b.auther=Herbert Schildt
System.out.print(b.title);
System.out.print(" is a "+b.book_type);
System.out.print(" it has "+b.page_no+" pages ");
System.out.print(" and it the author is "+b.auther);
}
 }

 Output: The Complete Reference is a textbook it has 1344 pages and it the author is Herbert Schildt

What is Inheritance in Java?

 Inheritance means Inherited property one to other. In Programming term Inheritance is extend a class property(like instance, function or method) to the other class.From which class inherit their property this is called base class or parent class and what inherit from a base is called child class or dived class.

What is Polymorphism in Java?

Polymorphism is a way in oops in java that can work one action in many Ways to draw a shape but draw a Shape like many ways to draw a rectangle, draw a circle draw a triangle, and draw a square shape etc.

What is Abstraction in Java?

Abstraction is a method that can hide methods or instance and show the process only access granted user. Abstraction is used to secure confidential information for security region.
For example, a program has many functions or methods that can use it everywhere that they want but require some functions or methods used in particular section, so use Abstraction to hide these functions or methods to use in the particular area or section.

What is Encapsulation in Java?

Encapsulation is method by this method we use a private or procreated method in a public method.

What is the advantage of OOPs concept java?

There are many advantages of oops concept of java, these are following:-
1. By OOPs methods managing programming structure easy and well-documented program.
2. OOPs, methods increase code re-usability. it means we can oops method make an object and use the same code with different parameter and input for different propose.
3. OOPs, methods are easy to use and modify programs.
4. OOPs, methods decrease complexity and optimized programs.
5. OOP,s methods provoid level by level security by abstraction.
6. OOP,s methods program easy to upgrade in future.
7. Mantaince is easy in the object-oriented programming.

Thanks, friends
To read this post I hope that you will like the post, Please rate my work for increase my confidence.
Please share this post also if find helpful to other.
Also you can

object oriented programming examples
object oriented programming concepts
object oriented programming languages
object oriented programming principles
object oriented programming paradigm
features of object oriented programming

Have a nice day, take care.

About Programming Shortcut

This is a programming learning website that can help you learn and when your write your programming code. And all programming code is compiled run programming code in the following programming language C, c++, Java, php and Javascript Languages. find your programming read, understand the programming then copy and past and run your program and save your golden time to typing the program becuse you learn more in leas time. All Programming is codeing is ease to understand the programming