Advertisement
Guest User

omar le crustacé

a guest
Dec 10th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package hello1;
  7.  
  8. import java.util.Scanner;
  9.  
  10. class langue{
  11. int lan;
  12. langue(int id){
  13. lan=id;
  14. }
  15.  
  16.  
  17. public void idLangue(){
  18. switch(lan){
  19. case 1: System.out.println(" Hello ");
  20. break;
  21. case 2: System.out.println(" Bonjour ");
  22. break;
  23. case 3: System.out.println(" Hola ");
  24. break;
  25. }
  26.  
  27. }
  28.  
  29. };
  30.  
  31. public class Hello1 {
  32. public static void main(String[] args) {
  33. langue Salut2 = new langue(2);
  34. Salut2.idLangue();
  35. Scanner sc = new Scanner(System.in);
  36. String nom;
  37. System.out.println(" Entrez votre nom et prénom; ");
  38. nom = sc.nextLine();
  39. System.out.println("Bonjour " + nom + "!!!!!");
  40. }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement