Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Junky

Thread: pass reference to constructions/methods

  1. #1
    oszc is offline Member
    Join Date
    Aug 2011
    Rep Power

    Default pass reference to constructions/methods

    BufferedReader (Reader in ), we can pass the subclass of Reader(e.g. FileReader).
    Does it mean we can always pass a subclass of a superclass which is demand in the construction/method?

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Rep Power

    Default Re: pass reference to constructions/methods

    Yes that is a benefit of having inheritance and polymorphism.
    sunde887 likes this.

Similar Threads

  1. Replies: 8
    Last Post: 04-16-2012, 11:00 PM
  2. static variable /pass by reference
    By katturv in forum New To Java
    Replies: 15
    Last Post: 10-03-2010, 08:17 AM
  3. How to create pass by reference??
    By --> xeiyne! in forum CLDC and MIDP
    Replies: 4
    Last Post: 04-08-2010, 06:43 PM
  4. Don't pass by reference
    By Lyven in forum Advanced Java
    Replies: 6
    Last Post: 11-16-2009, 06:06 PM
  5. Pass-by-reference
    By popjava in forum New To Java
    Replies: 1
    Last Post: 10-19-2009, 03:45 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