Skip to content

Instantly share code, notes, and snippets.

@ilyeshammadi
Created April 24, 2015 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilyeshammadi/1c40485645d4ecaf3d7e to your computer and use it in GitHub Desktop.
Save ilyeshammadi/1c40485645d4ecaf3d7e to your computer and use it in GitHub Desktop.
package com.company;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
private Scanner clavier = new Scanner(System.in);
public static void main(String[] args) {
// creation d'une list de auteurs initialement vide
ArrayList<Auteur> auteurs = new ArrayList<Auteur>();
// creation d'un auteur
Auteur auteur = new Auteur();
auteur.age = 30;
auteur.name = "cdf";
auteurs.add(auteur);
}
public static class Auteur{
private String name;
private int age;
public Auteur() {
this.name = name;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment