如何保存变量并在另一个函数中进行比较

时间:2014-02-25 20:36:36

标签: android

/* How to save object in a variable and send it to another function*/
     @Override
        public void onClick(View v) {
            int tappedapples=0;
            int colletedappels=0;
            // int mycollectedapples = 0;
            v.setVisibility(View.GONE);
            colletedappels = tappedapples;
            colletedappels++;
            txt.setText("" + colletedappels);
            Checkobjct(colletedappels);
        }

如何在变量中保存对象并将其发送到另一个函数

1 个答案:

答案 0 :(得分:0)

    boolean compare(YourClass object1, YourClass object2)
    {
        return object1.equals(object2);
    }