DEV Community

muthukumarasamy thangavel
muthukumarasamy thangavel

Posted on

Java OOPS Basic and Class

what is oops concept in java?
*oops --> Object Oriented Programming Structure *
--> OOPS is ideal for building scalable, reusable, and maintainable code.
-->Procedural programming is about writing procedures or methods that perform operations on the data, while object-oriented programming is about creating objects that contain both data and methods.

-->OOPS provides a clear structure for the programs.
-->OOPS helps to keep the Java code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug.
-->OOP makes it possible to create full reusable applications with less code and shorter development time.

OOPS:
*Class
*Object
*Inheritance
*Polymorphism
*Abstraction
*Encapsulation

*Class *
-->Create Class start with capital letter.
--> A class is a blueprint or prototype from which objects are created. This section defines a class that models the state and behavior of a real-world object.
--> class is a collections of objects and methods.
--> class space is not allowed except($,_) only allowed.
--> class are allowed numbers (middle and end only ) not allowed start.

Data Types:
*Byte (1byte)
*Short (2 byte)
*int (4 byte)
*Long (8 byte)
*float (4 byte)
*Double (8byte)
*Char ('A' only one character)
*boolean (True (or) False)

Java is define two data types:
1.primitive
2.Non-primitive

primitive:
-int
-short
-byte
-long
-double
-boolean
-char

Non-primitive:
-String
-Array

Top comments (0)