Java Program To Check Greater Between The Two Number: Import Class Public Static Void Throws Int Boolean New
Java Program To Check Greater Between The Two Number: Import Class Public Static Void Throws Int Boolean New
1. class prepost {
2. public static void main(String args[]){
3. int i=50;
4. System.out.println("The value is "+i +".");
5. System.out.println("The value of i++ is "+ i++ +".");
6. System.out.println("The value of ++i is "+ ++i +".");
7. System.out.println("The value of ++i is "+ ++i +".");
8. }
9. }
1. import java.io.*;
2.
3. class palindrome {
4. public static void main(String [] args) throws IOException{
5. try{
6. BufferedReader obc=new BufferedReader (new InputStreamReader(System.in));
7. int r,n1,n2;
8. int rev=0;
9. System.out.println("Enter the number: ");
10. n1=Integer.parseInt(obc.readLine());
11. n2=n1;
12.
13. while(n1>0) {
14. r=n1%10;
15. rev=rev*10+r;
16. n1=n1/10;
17. }
18.
19. if(rev==n2) {
20. System.out.println("The number is Palindrome Number.");
21. } else {
22. System.out.println("The number is not a Palindrome Number.");
23. }
24. } catch(IOException e) {
25. System.out.println("Wrong number entered.");
26. }
27. }
28. }
1. import java.io.*;
2. class stch {
3. public static void main(String [] args) throws IOException {
4. char ch;
5. DataInputStream din=new DataInputStream(System.in);
6. System.out.println("Enter the character: ");
7. ch=(char)(din.read());
8. switch (ch) {
9. case 'a':
10. case 'e':
11. case 'i':
12. case 'o':
13. case 'u':
14. {
15. System.out.println("The character character is a Vowel.");
16. break;
17. }
18.
19. case '0':
20. case '1':
21. case '2':
22. case '3':
23. case '4':
24. case '5':
25. case '6':
26. case '7':
27. case '8':
28. case '9':
29.
30. {
31. System.out.println("The character entered is a Number.");
32. break;
33. }
34. case 'v':
35. case 'n':
36. case 't':
37. case 'b':
38. case 'r':
39. case 'f':
40. {
41. System.out.println("The character entered is a Special Character.");
42. break;
43. }
44. default:
45. {
46. System.out.println("The character entered is Constant.");
47. break;
48. }
49. }
50. }
51. }