-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8771f44
commit 63581ec
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import java.util.Scanner; | ||
|
||
public class App { | ||
public static void main(String[] args) { | ||
Scanner scanner = new Scanner(System.in); | ||
System.out.println("Enter 1 for Arabic , 2 for English , 3 For Dutch"); | ||
int option = scanner.nextInt(); | ||
switch(option){ | ||
case 1: | ||
System.out.println("مرحبا"); | ||
break; | ||
case 2: | ||
System.out.println("Hello"); | ||
break; | ||
case 3: | ||
System.out.println("Hoi"); | ||
break; | ||
default: | ||
System.out.println("Error"); | ||
} | ||
|
||
if(option == 1){ | ||
System.out.println("مرحبا"); | ||
}else if(option == 2){ | ||
System.out.println("Hello"); | ||
}else if(option == 3){ | ||
System.out.println("Hoi"); | ||
}else{ | ||
System.out.println("Error"); | ||
} | ||
|
||
} | ||
} | ||
|
||
// Java Switch Statements | ||
// --------------------------------------------------------------------------------------------- | ||
// Use the switch statement to select one of many code blocks to be executed. | ||
// استخدم جملة سويتش لتحديد واحدة من العديد من مجموعات التعليمات البرمجية ليتم تنفيذها | ||
// --------------------------------------------------------------------------------------------- | ||
// switch(expression) { | ||
// case a: | ||
// // code block | ||
// break; | ||
// case b: | ||
// // code block | ||
// break; | ||
// default: | ||
// // code block | ||
// } | ||
// --------------------------------------------------------------------------------------------- | ||
// The default keyword specifies some code to run if there is no case match | ||
// --------------------------------------------------------------------------------------------- |