TP-programmation-orientee-o.../TP15/GenericiteSoustypageExempleTableau.java

15 lines
326 B
Java
Raw Normal View History

2023-06-20 19:02:09 +00:00
import java.util.ArrayList;
public class GenericiteSoustypageExempleTableau {
public static void main(String[] args) {
String[] ts = new String[2];
Object[] to = ts;
to[0] = "texte";
to[1] = 15.5;
System.out.println("premier élément : " + to[0]);
System.out.println("deuxième élément : " + to[1]);
}
}