need help w annotation spring core

package ru.alishev.springcourse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import javax.annotation.*; /** * @author Neil Alishev */ @Component public class ClassicalMusic implements Music { String[] arrClass = {"Hungarian Rhapsody", "Mass in B Minor", "3. Symphony No. 9 in D Minor, Op. 125"}; @PostConstruct public void doMyInit(){ System.out.println("Doing my init"); } @PreDestroy public void doMyDestroy(){ System.out.println("Doing my destroy"); } @Override public String[] getSong() { return arrClass; } }

have problem w @PostConstruct @PreDestroy
Cannot resolve symbol 'PostConstruct'
Cannot resolve symbol 'PreDestroy'
image.png
Was this page helpful?