🎯🎯 DAY 3- INTRODUCTION TO JAVA (II) 🎯🎯
Yho Codestars! It's day 3 and I still feel quite energetic👶 . So here is what I learned today, feel free to comment and follow my blog😁 . Today's JAVA lesson! The basic element of Java: Java has 3 basic elements; Class, Interface, and Enum. We can only write a java program with the aid of these 3 elements, without class and interface, there is no Java program. Syntax of the basic elements: Syntax is a set of rules we need to follow when writing a program. Class <Acess modifier> class <class name> { } Interface <Acess modifier> interface < interface name> { } Enum <Acess modifier> enum < enum name> { } Access modifiers provide access restrictions to a class. There are 4 types of access modifiers; Public Private protected Default We cannot declare a Java class as private, or protected, the same goes for interface and enum. Examples of the basic element's syntax: The example in the fi...