can objects be used without instantiating?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

can objects be used without instantiating??

28th Jun 2016, 6:47 PM
Shashank Kumar
4 Answers
0
No, we can't use without initiation. ....
28th Jun 2016, 6:57 PM
Siddhu Siddharth
Siddhu Siddharth - avatar
0
Just to put it another way if there's still confusion. creating the object is like designing a blueprint. Instantiating is building from the blueprint.
29th Jun 2016, 2:56 AM
James
James - avatar
0
If you don't want to instantiate an object, for e.g. if you just need to use a methods that will all ways return the same value whatever your object's variable are, you can use the static key word with your method, to bee able to use it like so: Class.methode () ,without using an instance of the class. When using System.out.println (), you call the println () methode of an OutputStream object declared as static in the System class.
2nd Jul 2016, 8:21 AM
TheSmiler
TheSmiler - avatar
0
u can use "static" class and methods.. so dat u dnt hv to bother about creating object u can use classname.method() directly . bt u can not use obj without instantiated. it will get error SYMBOL not found or something like this
11th Sep 2016, 8:19 PM
Bhushan Gaikwad
Bhushan Gaikwad - avatar