Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Coala {
- private Integer valor = 0;
- public Integer getValor() {
- return this.valor;
- }
- public void setValor(Integer valor) {
- this.valor = valor;
- }
- public void funcaoDoFor () {
- for (Integer i = 0; i < 10; i++) {
- this.setValor(i);
- }
- }
- }
- class App {
- public main() {
- Coala coala = new Coala();
- coala.funcaoDoFor();
- System.out.println(coala.getValor()) // vai printar 9
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement