Preview:
import java.util.Scanner;
public class etudiant{
    String nom,pren;
    int id;
    etudiant(String n,String p,int id){
        this.nom=n;
        this.pren=p;
        this.id=id;
    }
    void afficher(){
        System.out.println("le nom :" + this.nom +"\n le prenom :" + this.pren+ "\n le id :" + this.id);
    }

    public static void main(String []args){
        etudiant E1=new etudiant("sahar","mess",12906031);
        E1.afficher();
    }
    
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter