Results 1 to 2 of 2
  1. #1
    ashish kumar is offline Member
    Join Date
    Dec 2013
    Posts
    1
    Rep Power
    0

    Default Adding extra parameter in method without affecting other objects using method

    Hi,

    Is there any way in java by which I can add an extra parameter in a method and the objects which are already using that method do not have to change the method signature as per new signature.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,963
    Rep Power
    8

    Default Re: Adding extra parameter in method without affecting other objects using method

    Overload the method. Call the new method from the old method, passing in whatever default value you want for the new value.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Replies: 3
    Last Post: 01-20-2012, 10:34 PM
  2. Replies: 18
    Last Post: 04-18-2011, 05:39 AM
  3. Class<T> in method parameter
    By Onra in forum New To Java
    Replies: 4
    Last Post: 03-14-2011, 12:12 AM
  4. Method for adding and drawing several objects
    By Pillow in forum New To Java
    Replies: 2
    Last Post: 09-08-2010, 11:24 PM
  5. Can a method take itself as parameter?
    By bukake in forum New To Java
    Replies: 10
    Last Post: 09-06-2008, 09:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •