N
N
Neonoviiwolf2017-01-20 19:50:54
Java
Neonoviiwolf, 2017-01-20 19:50:54

How to understand entry in JAVA code?

Good!
A simple question, explain such an abbreviated notation

public void showResult(View v) {
        String result = "Товары в корзине:";
        for (Product p : boxAdapter.getBox()) {          //вот эта строка//
            if (p.box)
                result += "\n" + p.name;
        }
        Toast.makeText(this, result, Toast.LENGTH_LONG).show();
    }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima Melnyk, 2017-01-20
@Neonoviiwolf

Read about foreach and Iterator

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question