What is Local Variables?

  • They are Created inside method/method parameters/arguments or blocks.
  • They can be accessed inside the method or block only.
  • There is no default value for the local variable. We must initialize them before using it. Otherwise will throw compile time error.
  • They are stored in stack memory.
  • They are created when method starts and destroyed when method ends.
  • From java 10 version, we can just decalre a local variable like var a = 10; without specifying the actual data type. The data type will be detected automatically by the compiler.

What is Instance variable ?

https://dev.to/nanthini_ammu_ac02ad32802/instanceobject-variable-44od

What is static variable ?

  • A …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help