Posts by Leonardo Scalabrini • 41 points
3 posts
-
1
votes2
answers479
viewsA: Doubt about method of sum
Follow an example: public static void main(String[] args) { int[] vetor = new int[10]; int numeros; Scanner e = new Scanner(System.in); int soma = 0; for (int i = 0; i <= 10; i++) {…
-
0
votes1
answer488
viewsA: Java Static variable assignment and update
Search for Cloneable by Example: public class Jogador implements Cloneable { Jogador getClone() { try { return (Jogador) super.clone(); } catch (CloneNotSupportedException e) { return this; } } }…
-
0
votes1
answer269
viewsA: How to pass a class as a parameter in another class and return a variable that is within a Thread
I think you can try with Generics, for example: public class Dados<T> implements Runnable{ @Override public void run() { T object = (T)new Object(); } } public class App { public static void…