Computer Science, asked by wecwc4325, 1 year ago

Which variables are created when an object is created with the use of the keyword 'new' and destroyed when the object is destroyed?Local variables instance variables class variables static variables

Answers

Answered by iamsumit111
6

Answer:

class object is the class variable.

Answered by ravilaccs
0

Answer:

Instance variable variables are created when an object is created with the use of the keyword 'new' and destroyed when the object is destroyed

Explanation:

  • In simple terms instance variable is nothing but those are the variable declared inside the class and outside of the method.
  • Instance variables belong to an instance of a class. It means instance variables belong to an object and we know that an object is an instance of a class. Every object has its own copy of the instance variables.
  • Instance variables are declared in a class, but outside a method, constructor or any block.
  • Instance variables are created when an object is created with the use of the keyword 'new' and destroyed when the object is destroyed.
Similar questions