南岛清风
2021-01-20 23:44java大一学校作业,求助各位大佬。
In this assignment, you will create the User and Validator classes to answer questions about whether the data was entered correctly.
1) Create class User
2) This class must contain fields: firstName, secondName, id, age, gender, password, dateOfBirth.
3) All of the fields must to have Private access modifier.
4) id should be generated automatically.
5) Create constructor that accepts these fields
6) Create setter and getter functions for each field
7) Create function which prints all fields.
8) Create class Validator.
9) Create checkAge method to check if user has full 18.
10) Create checkPassword method. Password must contain at least 1 uppercase letter, 1 lowercase letter, 1 digit, 1 special symbol(@,$,!,^) and length more or equal to 8.
11) Create checkDate method. Date should follow dd/mm/yyyy pattern.
12) Create driver code inside of main() function which allows user to input data in console. All fields cannot be empty. If user entered some field wrong way the program should give an appropriate error.
- 点赞
- 回答
- 收藏
- 复制链接分享
6条回答
为你推荐
- 各位大佬请教一个java问题,求代码,最好能有注释
- java
- eclipse
- 1个回答
- 请问各位大佬这题怎么理解?
- java
- java-ee
- eclipse
- jar
- 1个回答
- Java链表的问题,求大佬帮忙
- java
- eclipse
- 1个回答
- Java单链表的问题,求大佬帮忙
- java
- 2个回答
- 大佬们,Java代码求教
- java
- 7个回答