Skip to content

Instantly share code, notes, and snippets.

@settlersxp
Last active July 15, 2022 10:48
Show Gist options
  • Save settlersxp/1cd402c0ddc0880de67fa1fb4fd0f959 to your computer and use it in GitHub Desktop.
Save settlersxp/1cd402c0ddc0880de67fa1fb4fd0f959 to your computer and use it in GitHub Desktop.
Java tutorial A
package com.company;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<Integer> lista_de_numere = new ArrayList<Integer>();
lista_de_numere.add(7);
lista_de_numere.add(37);
lista_de_numere.add(30);
Numbers qweq = new Numbers();
for(int i=0; i<lista_de_numere.size(); i++){
int numarul_curent = lista_de_numere.get(i);
qweq.MyMethod(numarul_curent);
}
}
}
class Numbers{
public void MyMethod(int j)
{
int i=0;
for (i = 0; i < j; i++) {
System.out.print(i+", ");
}
System.out.println(i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment