summaryrefslogtreecommitdiff
path: root/spring-framework/04-basic-no-xml/src/main/java/com/example/spring/Maths.java
blob: 8825be78b1d4285c8d7dc78602ab87a4d160191c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.example.spring;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Maths {
	
	@Value("10")
	private int b;
	
	public int getB() {
		return b;
	}

	public void setB(int b) {
		this.b = b;
	}


	public int add(int a) {
		return a + b;
	}
}