Created
September 11, 2016 12:13
-
-
Save ZhdanRuslan/2148ec9f0f73c106c7cfef6e256b0cdc to your computer and use it in GitHub Desktop.
Level 38, Lesson 08, Task 02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.test.level38.lesson08.task02; | |
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Target; | |
import java.util.ArrayList; | |
import java.util.List; | |
/* Неверные аннотации | |
Исправь неверные аннотации. Код должен компилировался без ошибок и предупреждений. | |
*/ | |
@Target(ElementType.METHOD) | |
@interface Main { | |
} | |
public class Solution { | |
@Main | |
public static void main(String[] args) { | |
Solution solution = new Solution().new SubSolution(); | |
solution.overriddenMethod(); | |
} | |
public void overriddenMethod() { | |
} | |
public class SubSolution extends Solution { | |
@Override | |
public void overriddenMethod() { | |
System.out.println(uncheckedCall()); | |
} | |
@SuppressWarnings("unchecked") | |
List uncheckedCall() { | |
List list = new ArrayList(); | |
list.add("hello"); | |
return list; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment