Last active
July 15, 2022 10:48
-
-
Save settlersxp/1cd402c0ddc0880de67fa1fb4fd0f959 to your computer and use it in GitHub Desktop.
Java tutorial A
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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