Results 1 to 7 of 7

Thread: Adapter class

  1. #1
    Anand Anil is offline Member
    Join Date
    Apr 2014
    Posts
    1
    Rep Power
    0

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,354
    Rep Power
    6

    Default Re: Adapter class

    You have to provide context. Where did you read it?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  3. #3
    sunikurhade is offline Member
    Join Date
    Apr 2014
    Posts
    2
    Rep Power
    0

    Default Re: Adapter class

    Adapter class is code of block which is complsory followed by users or made them compalsary used..

  4. #4
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,086
    Rep Power
    4

    Default Re: Adapter class

    Quote Originally Posted by sunikurhade View Post
    Adapter class is code of block which is complsory followed by users or made them compalsary used..
    Wait, what? When you posted this and read this again through the eyes of the OP, do you think he completely understands the Adapter pattern?
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    4,025
    Rep Power
    6

    Default Re: Adapter class

    Quote Originally Posted by SurfMan View Post
    Wait, what? When you posted this and read this again through the eyes of the OP, do you think he completely understands the Adapter pattern?
    Forget the OP, I don't even understand the answer.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #6
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: Adapter class

    There is more than one meaning, but the most common meaning in Java is a class that provides empty implementations of all the methods in an interface. Users of the API can avoid clutter in their code by extending the adapter class instead of implementing the interface.
    Get in the habit of using standard Java naming conventions!

  7. #7
    jashburn is offline Senior Member
    Join Date
    Feb 2014
    Posts
    219
    Rep Power
    1

    Default Re: Adapter class

    A couple of examples on the Adapter class:

    1. MouseAdapter

    Take a look at the class description. See also the tutorial on writing a mouse listener making use of MouseAdapter.

    2. WindowAdapter

    Take a look at the class description. See also the tutorial on writing a window listener, and how WindowAdapter fits in.

    Adapter classes can be used to ease the implementation of interfaces in general (i.e., not only for listener implementation.)

    There is a another called the Adapter Design Pattern. It is one of the GoF (Gang of Four) design patterns, and it is applied to enable dissimilar interfaces to work together. See Adapter pattern - Wikipedia, the free encyclopedia.

Similar Threads

  1. How to use variable in adapter class
    By rasen58 in forum Java Applets
    Replies: 2
    Last Post: 10-25-2012, 07:24 AM
  2. Replies: 5
    Last Post: 08-07-2009, 01:54 PM
  3. JDBC using adapter (and connection handles)
    By Gideonzx in forum Advanced Java
    Replies: 1
    Last Post: 07-28-2009, 07:54 AM

Posting Permissions

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