第一节课
多线程、并发。(后面重点)
数据库、数据结构(自学、基本概念)
面试: JAVA知识点、项目、计算机网络(不咋考)、
leetcode : 看常见和热度高的问题、不要太多精力
一定要动手
代码规范很重要
课堂学习:
DAY02
package com.situ.day02;
import org.junit.jupiter.api.Test;
import java.util.Scanner;
public class situ {
public static void main(String[] args){
}
@Test
public void test1(){
// byte short int long float double
int a1 = 5;
long b1 = a1;
System.out.println(b1);//结果是5 说明从小到大自动转换
double a = 3.14;
int b = (int)a;
System.out.println(b); // 结果是3,说明从大到小强制转换会丢失数据
}
@Test
public void test2(){
//运算符
System.out.println(8 / 2);//4
System.out.println(8 % 2);//0
//单目运算符
int a = 1;
int b = 2;
System.out.println(a++);//1
System.out.println(a);//2
System.out.println(++b);//3
System.out.println(b);//3
}
@Test
public void test3(){
//逻辑运算符
Scanner scanner = new Scanner(System.in);
System.out.println("请输入学生平时成绩");
System.out.println("请输入学生四级成绩");
int timescore = scanner.nextInt();
int examscore = scanner.nextInt();
System.out.println(timescore > 60 && examscore >400);//true
}
@Test
public void test4(){
// && || 短路
int num1 = 1;
int num2 = 3;
System.out.println(num1 < 0 && num1 > num2++);//false
System.out.println(num1);//1
System.out.println(num2);//3
System.out.println(num1 > 0 || num1++ < num2 );
System.out.println(num1);//1
System.out.println(num2);//3
}
@Test
public void test5(){
Scanner scanner = new Scanner (System.in);
System.out.println("请输入学生成绩");
double score = scanner.nextDouble();
if(score >= 90 && score < 100){
System.out.println("优秀");
}
else if (score >=80 && score < 90){
System.out.println("良好");
}
else if( score >= 70 && score < 80){
System.out.println("一般");
}
else if(score >= 60 && score < 70){
System.out.println("及格");
}
else {
System.out.println("不及格");
}
}
@Test
public void test6(){
// 三目运算符号
int num1 = 1;
int num2 = 2;
int max = num1 > num2 ? num1 : num2;
System.out.println(max);//2
}
}