Please enable JavaScript.
Coggle requires JavaScript to display documents.
Java OOPS - Coggle Diagram
Java OOPS
-
-
-
Constructors
-
-
-
-
We have a method with class name which will automatically created by java compiler
i.e.,
var employee = new Employee();
Here Employee()-> is Constructor
Benefits of Object-oriented
Programming
e.g: Cars-> Has hundreds or thousands of collaborating objects . All these objects are reusable & replaceble.
If any object fails Mechanic replaces with another object.
Reduce Complexity
Building an entire Car at a time is difficult but building single object and adding all parts is easy
-
Easier Maintenance
If Any object fails we repair or replace with another object without changing entire code.
Code Reuse
Once we build and test an Object we can use it anywher
e.g: In one Image editing app -> filters (objects) are also used in different image editing apps.
Which reduces to time to build another application So Faster Developement
Abstraction
-
After using this we see less Fields and Methods in main() method i.e., the interface is simple & easy to use (Interface is . method)
-
Coupling
A principle
-
-
Main() method dependent on Employee class to perform a task (to calculateWage of employee)
Coupling points-> instance or object of Employee class, set & get methods etc..
This isn't a bad because they all required to perform a task
But we should make the methods to Private that we are not using or not usable for completion of task. like get methods
-
-
-
-
Problem Solving
Process of defining a problem, identifying and comparing different solutions, and pick the one that best solves that problem with respect to the context and constraints and budget