PRO192_-_SU_2023_-_Block_5_-_RE_753.webp
Mai Linh 2001

PRO192_-_SU_2023_-_Block_5_-_RE_753.webp

(Choose 1 answer)
A. 21
B. 20
C. 19
D. 22
OD


What will be the output of following code?
class Employee{
private String dob;
public Employee(String dob) {
this.dob = dob:
}
public int getAge(){String[] t=dob.split("/");
int m=Integer.parseInt(t[1]);
int y=Integer.parseInt(t[2]);if(m<6)
return (2021-y);else
return (2021-y+1);
}
public class Main{
public static void main(String[] args) {
System.out.println(new Employee("11/06/2000").getAge());
}

Thông tin

Category
PRO192
Thêm bởi
Mai Linh 2001
Ngày thêm
Lượt xem
1,679
Lượt bình luận
15
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_SU_2023_-_Block_5_-_RE_753.webp
File size
54.5 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom