Method overloading
shape
this
keyword is a reference to the current instance of the class or struct in which it is used. It is used to access the members (fields, properties, methods) of the current object from within its instance methods or constructors. It provides a way to refer to the current object explicitly, which can be useful to disambiguate between class members and method parameters, or to pass the current object as an argument. final
keyword in Java provides a way to define constants, enforce method behavior (prevent overriding), and prevent inheritance. It is a powerful tool for ensuring that certain aspects of your program remain immutable and fixed, which can help improve code reliability, security, and maintainability. try
, catch
, finally
, throw
, and throws
. switch-case
statement to handle different arithmetic operations. The basic operations we’ll include are addition, subtraction, multiplication, and division. We'll take input from the user for two numbers and the operation they want to perform. ArrayList
and LinkedList
are classes that implement the List
interface, which is part of the Java Collections Framework. However, they have significant differences in terms of their underlying data structures, performance, and typical use cases.