dreamcats / java-notes Goto Github PK
View Code? Open in Web Editor NEW自己的学习笔记。包含:个人秋招经历、🐂客面经问题按照频率总结、Java一系列知识、数据库、分布式、微服务、前端、技术面试、每日文章等(持续更新)
Home Page: https://blog.heiye.site/
自己的学习笔记。包含:个人秋招经历、🐂客面经问题按照频率总结、Java一系列知识、数据库、分布式、微服务、前端、技术面试、每日文章等(持续更新)
Home Page: https://blog.heiye.site/
重载和重写的区别
此处提及
重载
发生在同一个类中,方法名必须相同,参数类型不同、个数不同、顺序不同,方法返回值和访问修饰符可以不同。
但是返回值和访问限制符号不同好像会报错。
public class HelloWorld {
public void testFoo(){
}
public String testFoo() {
return "";
}
}
报错:Duplicate method testFoo() in type HelloWorld
不做笔记了吗?
打开美团面经后显示的却是拼多多面经,能否抽空调整一下,谢谢买兄弟
感谢同学分享这么好的资源。多线程练习题的第二题是存在一定问题的(每个线程把自己的ID在屏幕上打印10遍,要求输出结果必须按ABC的顺序显示),已有的代码如果建立在start之后按照threadA threadB和threadC的顺序执行是没错的,但是实际上线程调度的顺序并不是start的顺序,所以会出现问题,经过测试也确实结果不符合题目要求,附上自己的思路。
public class Test2 {
//记录打印状态
private static int status = 0;
public static void main(String[] args) {
Runnable r = new Runnable() {
@Override
public void run() {
int id = Integer.valueOf(Thread.currentThread().getName());
//锁住
synchronized (this){
try {
for (int i = 0; i < 10; i++) {
//判断
while (status != id){
wait();
}
//干活
System.out.print((char)(id+'A'));
status = (status+1)%3;
//通知
notifyAll();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
};
new Thread(r, "0").start();
new Thread(r, "1").start();
new Thread(r, "2").start();
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.