Utilizor
Contact Us

Java OOP

Object-Oriented Programming.

Examples

OOP Concept

Creating a simple instance of a class.

// Simulating Class and Object
class Fruit {
    String name;
}

public class Main {
    public static void main(String[] args) {
        Fruit apple = new Fruit();
        apple.name = "Apple";
        System.out.println(apple.name);
    }
}

Test Your Knowledge

Java Quiz

No quiz available for this topic yet.