This website includes Education Information like a programming language, job interview question, general knowledge.mathematics

Education log

PageNavi Results No.

Ads

Saturday, February 18, 2023

what is adpater with example in java

 what is adpater with example in java


What is adapter with example?


In Android, Adapter is a bridge between UI component and data source that helps us to fill data in UI component. It holds the data and send the data to an Adapter view then view can takes the data from the adapter view and shows the data on different views like as ListView, GridView, Spinner etc.


example java adapter

public class RoundHole {

    private double radius;


    public RoundHole(double radius) {

        this.radius = radius;

    }


    public double getRadius() {

        return radius;

    }


    public boolean fits(RoundPeg peg) {

        boolean result;

        result = (this.getRadius() >= peg.getRadius());

        return result;

    }

}


No comments:

Post a Comment