public class ExampleClass { @Override public String toString() { return "This is an example"; } @Deprecated public void deprecatedMethod() { System.out.println("This method is deprecated"); } @SuppressWarnings("unchecked") public void suppressWarningMethod() { List<String> list = new ArrayList(); } @FunctionalInterface public interface ExampleInterface { void doSomething(); } public static void main(String[] args) { ExampleClass example = new ExampleClass(); example.deprecatedMethod(); example.suppressWarningMethod(); ExampleInterface exampleLambda = () -> System.out.println("Lambda expression example"); exampleLambda.doSomething(); } }


上一篇:
下一篇:
切换中文