development-programming-language-java-classes.html
            
                
                    
                        
                        * created: 2025-10-19T13:03
                        
                         
                        * modified: 2025-10-19T13:34
                        
                        
                    
                
                title
                Java Classes
                description
                An abstract description of objects, but also the entrypoint into every Java program.
                
                related notes
                
                
             
            Classes
Classes are the backbone of object oriented programming. They are not only an abstract way to represent objects, but also the entry point into every Java program.
Classes are datatypes. Operation on these datatypes are called methods.
Semantics
Class declaration are done by first defining the scope or visibility, followed by the class key word and then the identifier. The identifier has to be in PascalCase.
public class HelloWorld { ... }
The new keyword is used to declare a new instance of a class.
new SomeClass();
Methods
The entry class of program must contain a main method. Methods are defined using the visibility followed by an optional static keyword as well as the type of the returned value (if the return value is void the function is called a procedure) and an identifier which is followed by braces. The identifier ought to use camelCase. The braces can wrap some input parameter in braces.
public static void main(String[] args) { ... }