answersLogoWhite

0


Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Why do you need to create an instance?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What programs can use or create j.peg files?

MS Paint, for instance...


What is need for static method?

Static methods are methods that can be invoked without creating an instance of the class that contains them. They are needed in cases where the programmer would not want to create multiple instances of a class to execute a method.


What is mean by instance variable with example?

hi friend.... Instance variable means with which you need to create an obeject in order to invoke any methods or variables defined in a class. For ex: class A { int a=10; public void inc() {return a++; } } To invoke a member A b=new A(); b.inc(); System.out.println(b.a); If incase of a static method you can directly call using class name itself. like : b=Math.sqrt(a);


What is instantiating in java?

To instantiate is to create a new "instance" of an "object" in object-oriented programming. For example, say you create an Object by defining a class called Square: (note: this is C++ but the principles are the same) class Square{ private: int length, width; public: getArea(){return length*width); }; The above class is an Object. When you create this object, that is called an "instance" of the object: int main() { Square x = new Square; // x is an "instance" of the Square "object" Square y = new Square; // y is a separate "instance" of the Square "object" return 0; }


What is meant by instancing a class?

The class can be considered a template to create objects. When you create an object, you create it on the basis of the specified class - the object is an instance of the class, and the act of creating the object is also known as "instantiating" the class.

Related questions

What do you mean by Get instance?

It means create an object for a class. Instance refers to the obj of a class.


Use of constructor?

to create an instance of object


Why you use constructors?

To create an instance of the class that implementing that constructor


What programs can use or create j.peg files?

MS Paint, for instance...


For what purpose constructors are used in Java?

Constructors are used to create the instance of a class.


What is the difference between class variables and instance variables?

In the case of an instance variable, there is one copy for every instance (object). If you create 10 objects based on a class, there will be 10 copies of the variable. A class variable exists only once for the entire class - no matter how many objects you create - or even if you create no objects based on the class. In Java, such variables (class variables) are declared with the statickeyword.


Why does the cell need RNA?

RNA and DNA are nucleus acids witch help the procedure to create proteins, in the human body, cause the human body with out proteins can't function.(For instance grow a tooth.)


Does breast reduction procedure harm the milk ducts and create a problem in the future when i need to breastfeed my baby?

It depends whether they have taken out your milk ducts or not. In the Uk, they often do whereas in France for instance they don't.


What is need for static method?

Static methods are methods that can be invoked without creating an instance of the class that contains them. They are needed in cases where the programmer would not want to create multiple instances of a class to execute a method.


How do you make enemies shoot in game maker?

A simple way is to set random alarms.E.g.Create Event:set Alarm 0 to random(100)Alarm Event for alarm 0:create instance of object obj_bullet at relative position (0,0)create instance of object obj_bullet at relative position (0,0)create instance of object obj_bullet at relative position (0,0)set Alarm 0 to random(100)Simples!


What is a new keyword in java methods?

new is a keyword to create a instance of object any class.


How do you create a teenbiz3000 account?

i need to create a teenbiz