pkg.AnnotationsMain.java Source code

Java tutorial

Introduction

Here is the source code for pkg.AnnotationsMain.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pkg;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.*;

/**
 *
 * @author ICBC
 */
public class AnnotationsMain {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(AnnotationConfig.class);

        Annotations annotation = ctx.getBean(Annotations.class);

        annotation.setMessage("Hello World!");
        annotation.getMessage();
    }
}