import(2)
-
spring2
bean 경로 error로 설정시 깔끔하게 나옴 ApplicationContext ctx = new GenericXmlApplicationContext("file:\\c:\\upload\\person.xml"); ApplicationContext ctx = new GenericXmlApplicationContext("classpath:stu.xml"); Student s1 = ctx.getBean("xxx", Student.class); System.out.println(s1); Student s2 = (Student)ctx.getBean("xxx"); s2.setAge(20); s2.setName("이순신"); System.out.println(s2.toString()); Student [name=홍길..
2024.02.05 -
메소드
메소드 String name; int age; String addr; public Student (Strung name, int age, String addr){ super(); sysout("매개변수 3개짜리 생성자"); this.name = name; this.age = age; this.addr=addr; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getAddr() { return addr; } ..
2023.12.06