DEV Community

Kiruthiga S
Kiruthiga S

Posted on

Java

OOP (Object Oriented Programming)
OOP is idea
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of objects that contain data (fields) and behavior (methods). It focuses on designing software that closely represents real-world entities.

Class
- Blueprint or template
- Starts with uppercase
- The letter starts with capital letter is always class
- No space allowed and no special characters except _ and $

Data Types in Java
1.Primitive datatype
byte - 1byte
small - 2byte
int - 4byte
long - 8byte
float - 4byte
double - 8byte
char - 2byte
boolean - 1byte

2.Non-primitive datatype
String
Array

public class Home{
static String name="Kiruthiga";
static int age=21;
public static void main(String[] args)
{
    System.out.println(Home.name);
    System.out.println(Home.age);
    // system.out.println("Hello World!");
}
}
Enter fullscreen mode Exit fullscreen mode

Output
Kiruthiga
21

Top comments (0)