We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61d3432 commit 0d366f0Copy full SHA for 0d366f0
1 file changed
Leap_year.java
@@ -0,0 +1,32 @@
1
+import java.util.*;
2
+class A
3
+{
4
+ public int year;
5
+
6
+ public void get_in()
7
+ {
8
+ System.out.println("Enter an Year :: ");
9
+ Scanner sc = new Scanner(System.in);
10
+ year = sc.nextInt();
11
+ }
12
+}
13
14
+class B extends A
15
16
+ public void print_out()
17
18
+ if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0))
19
+ System.out.println("Specified year is a leap year");
20
+ else
21
+ System.out.println("Specified year is not a leap year");
22
23
24
+public class Leap_year
25
26
+ public static void main(String[] args)
27
28
+ B b = new B();
29
+ b.get_in();
30
+ b.print_out();
31
32
0 commit comments