OOP key points
Key Points Of Object Oriented
Programming (OOP)
Object Oriented Programming:-
- It is a computer programming model based on object. We can use it in various programming languages to develop a program.
Building Blocks of OOP
- Object:-
Object can be define as data field that has unique attributes and behaviors. Objects can correspond to real-world objects or an abstract entity.
2.Class:-
Class is a sketch used to implement an object at the programming level.
And also we an define class as "A template that can keep the things what we need".
3.Method:-
A method in OOP is a block of code that, when called, performs specific actions mentioned in it.
4.Variable:-
Variables are containers for storing data values. In Java, there are different types of variables, for example:
int
double
OOP Standard
Coding standards help in the development of software programs that are less complex and thereby reduce the errors.
Object-Oriented Programming (OOP) standards are used for several reasons,
- Modularity and Reusability
- Ease of Maintenance
- Code Readability and Understandability
- Open and closing curly bracket-
- We use "{}" syntax for this.
- We use this to denote blocks of code or to define the scope of a class, method, or other code structures.
- Semi Colon-
- We use ";" syntax for this.
- It is used as a statement terminator. It indicates the end of a statement or a complete command.
- Dot Operator-
- We use "." syntax for this.
- It is used as an operator to access members (attributes or methods) of an object or a class. The dot notation is crucial for interacting with objects and invoking their behaviors.
- Class-
- First letter should be in uppercase.
- Ex- public class MyClass {}
- Variable-
- Variables are containers for storing data values
- All characters should be in lowercase.
- Ex-
public class MyClass
{
int number;
char letter;
}
- Methods-
- All characters should be in lower case and with parameters.
- Ex-
public class MyClass
{
int number;
char letter;
{
}
}
Comments
Post a Comment