publicclassTest01{publicstaticvoidmain(String[] args){//1.获取BookShelf的class对象Class<BookShelf> bookShelfClass =BookShelf.class;//2.判断bookShelf上有没有Book注解boolean b = bookShelfClass.isAnnotationPresent(Book.class);//3.判断,如果b为true,就获取if(b){Book book = bookShelfClass.getAnnotation(Book.class);System.out.println(book.bookName());System.out.println(Arrays.toString(book.author()));System.out.println(book.price());System.out.println(book.count());}}}