To packets are essentials
[Link]
[Link]
Here we use extends keyword to create a Child class from a parent class.
W02_9 inside class
Feature Local Variable Instance Variable Class Variable (static)
Declared Method, constructor, or Inside class, but outside Inside class with static
inside block any method keyword
Available to all
Available only within that Available to all objects
Scope methods/constructors of
method/block of the class
object
Created when method starts, Exists as long as object Exists as long as class is
Lifetime
destroyed when ends exists loaded in memory
Memory Heap (each object has its Method area / Class
Stack
location own copy) area (single shared copy)
❌ Must be initialized ✅ Default values assigned ✅ Default values assigned
Default value
before use automatically automatically
Through object reference Through class name
Access Only inside the method
([Link]) ([Link]) or object
Modifier Can use access modifiers Must use
Cannot use static
allowed (public, private) static
Println- after printing goes to next line
Print- after printing curser not goes to next line
Print(“/n”)—used to start newline
We can use printf command also, when we use Printf the formatting print will go on, so we
need to follow the rules as in C/C++
V= [Link](arg[])
Converts string input (args[]) into Int format, Integer is a class in [Link], parseInt is a
method.
[Link](args[])
[Link](args[])
[Link](args[])
etc
Wrapper Class Primitive Type Parsing Method Example
Integer int int x = [Link]("123");
Double double double d = [Link]("12.34");
Float float float f = [Link]("3.14");
Long long long l = [Link]("12345");
Short short short s = [Link]("10");
Byte byte byte b = [Link]("5");
Boolean boolean boolean flag = [Link]("true");
[Link].