Java Programs SpringBoot
Java Programs SpringBoot
Examples
WAP to implement the following new features in Java
import java.util.function.Predicate;
@FunctionalInterface
interface StringChecker {
boolean check(String s);
import java.lang.annotation.*;
import java.lang.reflect.*;
import java.util.List;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface MyAnnotation {
String value() default "Default";
}
class Demo {
@Deprecated
public void oldMethod() {
System.out.println("Deprecated method");
}
@SuppressWarnings("unchecked")
public void warningMethod() {
List rawList = List.of("Java", "Annotations");
List<String> stringList = rawList;
System.out.println(stringList);
}