Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package hello1;
- import java.util.Scanner;
- class langue{
- int lan;
- langue(int id){
- lan=id;
- }
- public void idLangue(){
- switch(lan){
- case 1: System.out.println(" Hello ");
- break;
- case 2: System.out.println(" Bonjour ");
- break;
- case 3: System.out.println(" Hola ");
- break;
- }
- }
- };
- public class Hello1 {
- public static void main(String[] args) {
- langue Salut2 = new langue(2);
- Salut2.idLangue();
- Scanner sc = new Scanner(System.in);
- String nom;
- System.out.println(" Entrez votre nom et prénom; ");
- nom = sc.nextLine();
- System.out.println("Bonjour " + nom + "!!!!!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement