So. Brackets contain code that represent the operations of your program. Use bracket whenever you need to define a class, method, or function. For instance, the “main” method, or your class:
MyClass{
My constructors, fields, getters, setters, instance methods, class methods, inner/nested classes, and my “main” method.
}
If I define a new method, the brackets would be used like this:
Public void myMethod( arguments){ method definition/my code here
}
Finally, think of brackets as an encapsulation or nesting tool, where code, classes, methods, or functions, are encapsulated or nested within other code, like this:
Public void myMethod(arguments){
My code {
More code/another function} //end of inner code
} //end of myMethod()