Can anyone tell me what INSTANTIATE means in a java program, with a possible Example.
Here's another forum somebody already explained it in always check google first here's the link http://forums.dreamincode.net/showtopic13782.htm
Insantiate means 'to create an instance of'. In object oriented programming, objects are defined by classes, a class being a 'blueprint' of an object.
For example, think about chocolate chip cookies. You make them by following a recipe. The recipe defines what it is to 'be' a chocolate chip cookie. You can't use it to make oatmeal cookies or peanutbutter cookies, only chocolate chip cookies, because chocolate chip cookies have attributes that are unique to their type.
Instantiating a chocolate chip cookie means to create a single cookie by using the recipe (class). So, if I created a class called 'CCCookie', I would instantiate a 'CCCookie' with code like this:
CCCookie myCookie = new CCCookie();
I could make another one:
CCCookie yourCookie = new CCCookie();
I have now instantiated two of them...but they are totally independent of each other. If I were to execute the code
It would not affect yourCookie in any way, because they are separate instances of the CCCookie class.
Hope this helps.
By Kallahan in forum Java
Last Post: 01-20-2003, 09:28 AM
By Novosoft in forum web.announcements
Last Post: 02-14-2001, 04:50 AM
By Philip King in forum authorevents.appleman
Last Post: 04-10-2000, 01:27 AM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center