() -is it a function or not & if it is what's its name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Apoorv
    New Member
    • Feb 2010
    • 1

    () -is it a function or not & if it is what's its name

    obj.<methodname >=new <classname> ()
  • justwantananswer
    New Member
    • Feb 2010
    • 3

    #2
    "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> () ".

    Comment

    • ahmee
      New Member
      • Mar 2010
      • 39

      #3
      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 String

      Comment

      Working...