summaryrefslogtreecommitdiff
path: root/spring-framework/03-basic-component-scan/src/main/java/com/example/spring/Maths.java
blob: 3a0b822e5e07a7b7bb471f0d72d2af21d5019a17 (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("100")
	private int b;
	
	public int getB() {
		return b;
	}

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


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