-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathExample3.java
More file actions
38 lines (32 loc) · 864 Bytes
/
Example3.java
File metadata and controls
38 lines (32 loc) · 864 Bytes
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
38
package javatips.debug;
/**
* 回到上一步
*
* @author biezhi
* @date 2018/8/14
*/
public class Example3 {
private static int excludeO(String str) {
str = str.toLowerCase();
int count = str.replaceAll("[^o]+", "").length();
System.out.println("asdasdad");
return count;
}
static class User {
String username;
String password;
public User(String username, String password) {
this.username = username;
this.password = password;
}
}
public static void main(String[] args) {
User user = new User("biezhi", "123456");
if(user.username.isEmpty()){
System.out.println("username is empty.");
}
String name = "Hello W0rld";
int count = excludeO(name);
System.out.println(count);
}
}