java Spring初学问题
初学java Spring代码时看到一个输出不知道是什么意思代码是在黑马这个机构获取的
package com.itheima.ui;
import com.itheima.dao.IAccountDao;
import com.itheima.service.IAccountService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Client {
public static void main(String[] args) {
//1.获取核心容器对象
ApplicationContext ac = new ClassPathXmlApplicationContext("bean.xml");
//2.根据id获取Bean对象
IAccountService as= ac.getBean("accountService",IAccountService.class);
IAccountDao adao = ac.getBean("accountDao",IAccountDao.class);
System.out.println(as);
System.out.println(adao);
as.saveAccount();
adao.saveAccount();
}
输出内容为
com.itheima.service.impl.AccountServiceImpl@4e08711f
com.itheima.dao.impl.AccountDaoImpl@bcec361
对象创建了
保存了账户
红色字体的是什么?
输出的就是accountService.java和account.java的信息 肖-肖 发表于 2021-5-2 15:36
输出的就是accountService.java和account.java的信息
能不能详细一点大佬,是这两个类的什么信息鸭? DreamNext、初墨 发表于 2021-5-2 16:01
能不能详细一点大佬,是这两个类的什么信息鸭?
应该是accountService这个对象和accountDao这个对象所在的包的信息加区分对象用的序列码信息
页:
[1]