Naming Convention
public class Car { // class body } public interface Vehicle { // interface body }public void calculateArea() { // method body } public void printDetails() { // method body }public class Example { private int count; // instance variable public void setCount(int count) { this.count = count; // using "this" for instance variable } }public class Constants { public static final double PI = 3.14159; public static final int MAX_VALUE = 100; }package com.example.project;public enum DaysOfWeek { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY }public class User { private boolean isActive; public boolean isActive() { return isActive; } }
Last updated