-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringDemo2.java
More file actions
22 lines (18 loc) · 517 Bytes
/
StringDemo2.java
File metadata and controls
22 lines (18 loc) · 517 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package StringDemos;
import java.util.Scanner;
public class StringDemo2 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the String");
String data = scanner.next();
StringBuffer sb = new StringBuffer(data);
// for(int i = 0 ; i<data.length(); i++){
for (int i = 0; i < sb.length(); i++) {
char e = sb.charAt(0);
sb.append(e);
sb.deleteCharAt(0);
// data = data.substring(1)+data.charAt(0);
System.out.println(sb);
}
}
}