-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnnotationsBasics.java
More file actions
37 lines (31 loc) · 950 Bytes
/
AnnotationsBasics.java
File metadata and controls
37 lines (31 loc) · 950 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
/**
* Created by Admin on 12-04-2017.
*/
public class AnnotationsBasics {
@Deprecated
public static void deprecatedMethod(){
System.out.println("Deprecated hai yeh");
}
public void overridenMethod(){
System.out.println("Yeh method overriden hai");
}
@SuppressWarnings({"deprecation", "unchecked"})
public static void suppressedWarnings(){
deprecatedMethod();
System.out.println("IDE warnings nhi dikhayega");
}
public @interface YeBikGayiHaiGormint{
int value();
}
@YeBikGayiHaiGormint(1)
public static void main(String[] args){
deprecatedMethod();
new AnnotationsBasics().new NestedClass().overridenMethod();
}
class NestedClass extends AnnotationsBasics{
@Override
public void overridenMethod(){
System.out.println("Yeh method overriden hai");
}
}
}