obj.<methodname >=new <classname> ()
() -is it a function or not & if it is what's its name
Collapse
X
-
"new <classname> ()" is the call to create a new instance of class "classname" by using its default constructor.
By the way, I think "obj.<methodnam e>=new <classname> () " is incorrect. You cannot change a method of a object. It should be "obj.<attri bute name>=new <classname> () ". -
its not a function,it used as pasing argument in it or used as default constructor.... below exmple
String s="abc";
String s= new String():
This new is reversed key word used to create a instance of class mean a instance of s is made so this s will take all property of class StringComment
Comment