Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Automatic variables

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are local variables called as automatic variables ?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because they get automatically destroyd when they get out of scope.
 
Ilangovan Chandran
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Local variables or automatic variables are declared in methods of a class.These variables are loaded when a objec method is called and destroyed when the method completed.
Thus it is called as automatic or local variable.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic