学这个JavaWeb需要把项目链接里的java的课学到哪节课啊?
javaweb链接:
https://www.bilibili.com/video/BV1yGydYEE3H?p=2&vd_source=2ef9210bca6a7a3313c5f82f0eb6a8ec
java课程链接【 】https://www.bilibili.com/video/BV1gb42177hm?vd_source=2ef9210bca6a7a3313c5f82f0eb6a8ec
学这个JavaWeb需要把项目链接里的java的课学到哪节课啊?
javaweb链接:
https://www.bilibili.com/video/BV1yGydYEE3H?p=2&vd_source=2ef9210bca6a7a3313c5f82f0eb6a8ec
java课程链接【 】https://www.bilibili.com/video/BV1gb42177hm?vd_source=2ef9210bca6a7a3313c5f82f0eb6a8ec
关注让 “紫雾凌寒” 来帮你回答,本回答结合 DeepSeek
如果还有问题,请评论或点击头像私信,如果有帮助到您, 请关注、采纳、点赞
// 声明一个整型变量
int num = 10;
// if - else语句示例
if (num > 5) {
System.out.println("num大于5");
} else {
System.out.println("num小于等于5");
}
// for循环示例
for (int i = 0; i < 5; i++) {
System.out.println("当前循环次数: " + i);
}
// 定义一个类
class Person {
private String name;
public void setName(String n) {
name = n;
}
public String getName() {
return name;
}
}
// 创建对象并使用
Person person = new Person();
person.setName("张三");
System.out.println(person.getName());
try - catch - finally块的使用。try {
int result = 10 / 0; // 会抛出异常
} catch (ArithmeticException e) {
System.out.println("发生了算术异常: " + e.getMessage());
} finally {
System.out.println("无论是否有异常都会执行");
}
String类、ArrayList等集合类的使用。// String类示例
String str = "Hello";
System.out.println(str.length());
// ArrayList示例
import java.util.ArrayList;
ArrayList<Integer> list = new ArrayList<>();
list.add(1);
list.add(2);
System.out.println(list.get(0));
FileInputStream和FileOutputStream读写文件。import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class FileIOExample {
public static void main(String[] args) {
try {
FileInputStream fis = new FileInputStream("input.txt");
FileOutputStream fos = new FileOutputStream("output.txt");
int data;
while ((data = fis.read()) != -1) {
fos.write(data);
}
fis.close();
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
希望以上解答对您有所帮助。如果您有任何疑问,欢迎在评论区提出。