先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7
深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
如果你需要这些资料,可以添加V获取:vip1024b (备注Java)
正文
System.out.println(ac);
}
}
运行程序后,后台执行结果:
演示 创建对象的方式:
ExampleBean.java
package container.instantiation;
public class ExampleBean {
public ExampleBean() {
System.out.println(“ExamleBean的无参构造器…”);
}
}
TestCase.java
package test;
import java.util.Calendar;
import java.util.Date;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import container.instantiation.ExampleBean;
public class TestCase {
@Test
//测试容器创建对象的第一种方式(调用无参构造器)
public void test1(){
//启动容器
ApplicationContext ac = new ClassPathXmlApplicationContext(“applicationcontext.xml”);
System.out.println(ac);
//向容器申请获得一个对象
ExampleBean eb1 = ac.getBean(“eb1”, ExampleBean.class);
System.out.println(eb1);
Date date1 = ac.getBean(“date1”, Date.class);
System.out.println(date1);
}
@Test
//测试容器创建对象的第二种方式(静态工厂方法)
public void test2(){
//启动容器
ApplicationContext ac = new ClassPathXmlApplicationContext(“applicationContext.xml”);
System.out.println(ac);
Calendar cal = ac.getBean(“cal1”, Calendar.class);
System.out.println(cal);
}
@Test
//测试容器创建对象的第三种方式(实例工厂方法)
public void test3(){
//启动容器
ApplicationContext ac = new ClassPathXmlApplicationContext(“applicationContext.xml”);
System.out.println(ac);
Date date = ac.getBean(“time1”, Date.class);
System.out.println(date);
}
}
依次运行test1,test2,test3,后台运行结果:
A.
B.
C.
生命周期的管理、作用域、延迟加载****演示
MessageBean.java
package container.life;
public class MessageBean {
public MessageBean(){
System.out.println(“MessageBean的无参构造器…”);
}
public void init(){
System.out.println(“init方法…”);
}
public void sendMsg(){
System.out.println(“发送消息…”);
}
public void destroy(){
System.out.println(“destroy方法…”);
}
}
SomeBean.java
package container.life;
public class SomeBean {
public SomeBean(){
System.out.println(“SomeBean的无参构造器…”);
}
}
app2.xml
<?xml version="1.0" encoding="UTF-8"?><beans xmlns=“http://www.springframework.org/schema/beans”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:context=“http://www.springframework.org/schema/context”
xmlns:jdbc=“http://www.springframework.org/schema/jdbc”
xmlns:jee=“http://www.springframework.org/schema/jee”
xmlns:tx=“http://www.springframework.org/schema/tx”
xmlns:aop=“http://www.springframework.org/schema/aop”
xmlns:mvc=“http://www.springframework.org/schema/mvc”
xmlns:util=“http://www.springframework.org/schema/util”
xmlns:jpa=“http://www.springframework.org/schema/data/jpa”
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">
<bean id=“mb1”
class=“container.life.MessageBean”
init-method=“init”
destroy-method=“destroy”
scope=“prototype”>
<bean id=“sb1” class=“container.life.SomeBean”
scope=“prototype”>
<bean id=“sb2” class=“container.life.SomeBean”
lazy-init=“true”>
TestCae2.java
package test;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import container.life.MessageBean;
import container.life.SomeBean;
public class TestCae2 {
@Test
//测试生命周期相关的几个
public void test1(){
//关闭容器的方法在ApplicationContext
//接口当中没有提供,需要使用其子接口
//AbstractApplicationContext
AbstractApplicationContext ac = new ClassPathXmlApplicationContext(“app2.xml”);
MessageBean mb = ac.getBean(“mb1”,MessageBean.class);
mb.sendMsg();
System.out.println(mb);
ac.close();
}
@Test
//测试作用域
public void test2(){
ApplicationContext ac = new ClassPathXmlApplicationContext(“app2.xml”);
SomeBean sb1 = ac.getBean(“sb1”, SomeBean.class);
SomeBean sb2 = ac.getBean(“sb1”, SomeBean.class);
System.out.println(sb1 == sb2);
}
@Test
//测试作用域 (lazy-init)
public void test3(){
ApplicationContext ac = new ClassPathXmlApplicationContext(“app2.xml”);
SomeBean sb2= ac.getBean(“sb2”, SomeBean.class);
}
}
依次运行test1、test2、test3,运行结果如下
A.
B.
C:
没有getBean获取对象时不会创建对象:
IOC(Inversion Of Controll 控制反转) 演示
app3.xml
<?xml version="1.0" encoding="UTF-8"?><beans xmlns=“http://www.springframework.org/schema/beans”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xmlns:context=“http://www.springframework.org/schema/context”
xmlns:jdbc=“http://www.springframework.org/schema/jdbc”
xmlns:jee=“http://www.springframework.org/schema/jee”
xmlns:tx=“http://www.springframework.org/schema/tx”
xmlns:aop=“http://www.springframework.org/schema/aop”
xmlns:mvc=“http://www.springframework.org/schema/mvc”
xmlns:util=“http://www.springframework.org/schema/util”
xmlns:jpa=“http://www.springframework.org/schema/data/jpa”
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">
Restaurant.java
package container.ioc.constructor;
public class Restaurant {
private Waiter wt;
public Restaurant(){
System.out.println(“Restaurant的无参构造器…”);
}
public Restaurant(Waiter wt){
System.out.println(“Restaurant的带参构造器…”);
this.wt = wt;
}
@Override
public String toString() {
return “Restaurant [wt=” + wt + “]”;
}
}
Waiter.java
package container.ioc.constructor;
public class Waiter {
public Waiter() {
System.out.println(“Waiter的无参构造器…”);
}
}
A.java
package container.ioc.set;
public class A {
private B b;
public B getB() {
return b;
}
public void setB(B b) {
System.out.println(“A的setB方法…”);
this.b = b;
}
public A(){
System.out.println(“A的无参构造器…”);
}
public void execute(){
b.f1();
}
}
B.java
package container.ioc.set;
总结
总的来说,面试是有套路的,一面基础,二面架构,三面个人。
最后,小编这里收集整理了一些资料,其中包括面试题(含答案)、书籍、视频等。希望也能帮助想进大厂的朋友
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
java
package container.ioc.set;
public class A {
private B b;
public B getB() {
return b;
}
public void setB(B b) {
System.out.println(“A的setB方法…”);
this.b = b;
}
public A(){
System.out.println(“A的无参构造器…”);
}
public void execute(){
b.f1();
}
}
B.java
package container.ioc.set;
总结
总的来说,面试是有套路的,一面基础,二面架构,三面个人。
最后,小编这里收集整理了一些资料,其中包括面试题(含答案)、书籍、视频等。希望也能帮助想进大厂的朋友
[外链图片转存中…(img-MC5v6oVo-1713458562918)]
[外链图片转存中…(img-82TplC5v-1713458562920)]
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)
[外链图片转存中…(img-2Ecqh5U4-1713458562920)]
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!