-
Notifications
You must be signed in to change notification settings - Fork 3
/
prog23.java
37 lines (33 loc) · 927 Bytes
/
prog23.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//not working dont know why.... :( ;(
package chapter3;
import java.util.*;
public class prog23
{
void fetchTheString(String inputstring)
{
int j;
int lengthOfstring = inputstring.length();
String alplower = "";
String alpupper = "";
char temp;
for (j = 0; j < lengthOfstring; j++) {
temp = inputstring.charAt(j);
if (temp >= 'A' && temp <= 'Z') {
alpupper+= temp;
}
else {
alplower += temp;
}
}
System.out.println(alplower + alpupper);
}
public static void main(String args[])
{
String inputstring;
Scanner in=new Scanner(System.in);
System.out.println("Enter the String:");
inputstring=in.nextLine();
prog23 ce=new prog23();
ce.fetchTheString(inputstring);
}
}