Professional Documents
Culture Documents
Unit 5 CS
Unit 5 CS
Unit 5 CS
Constructor
Methods
● Void
● Return
● toString
Static
Static variables belong to the class, with all objects of a class sharing a single static variable.
Local Variables:
Scope: Limited to the block of code where they are declared (e.g., within a method, constructor,
or a block).
Lifetime: Created when the block is entered and destroyed when the block exits.
Usage: Used for temporary storage within a method or block of code.
This