1、軟件生命周期一般包括哪幾個階段顾复?
- 軟件定義與可行性分析
- 需求分析
- 軟件設計(概要設計哑芹、詳細設計)
- 編碼
- 軟件測試
- 運行和維護
2、程序的三種基本結構是什么捕透?
- 順序結構
- 選擇結構
- 循環(huán)結構
3聪姿、java泛型、類型通配符
乙嘀? 表示不確定的java類型
T (type) 表示具體的一個java類型
K V (key value) 分別代表java鍵值中的Key Value
E (element) 代表Element
- 泛型
/**
* Created by Administrator on 2020/4/18.
*/
public class testGeneric {
public static void main(String[] args) {
Integer[] intArray={1,2,3,4};
Double[] doubleArray={0.2,3.4,2.3};
String[] strArray={"123","abc","test"};
printArray(intArray);
printArray(doubleArray);
printArray(strArray);
}
private static <E> void printArray(E[] array){
for(E element : array){
System.out.println(element);
}
}
}
-
類型通配符
上界通配符 < ? extends E>
上界:用 extends 關鍵字聲明末购,表示參數(shù)化的類型可能是所指定的類型,或者是此類型的子類虎谢。
下界通配符 < ? super E>
下界: 用 super 進行聲明盟榴,表示參數(shù)化的類型可能是所指定的類型,或者是此類型的父類型婴噩,直至 Object
4擎场、Mysql
-
從命令行連接MySQL
mysql安裝目錄下運行cmd
mysql -u root -p
根據(jù)提示輸入密碼即可
- 修改當前用戶密碼
alter user user() identified by '密碼';
- 創(chuàng)建數(shù)據(jù)庫StudyTest
create database StudyTest;
- 列出數(shù)據(jù)庫
show databases;
- 建表
create table student(
id int not null primary key auto_increment,
name varchar(20) not null,
sex char(1) not null
);
create table studentScore(
studentid int not null primary key,
course varchar(20),
score int(4),
foreign key fk_s(studentid) references student(id)
);
- 插入數(shù)據(jù)
insert into student
(id,name,sex)
values
(1,'張三','男'),
(2,'李四','男'),
(3,'翠花','女');
insert into studentScore
values
(1,'高數(shù)',80),
(1,'數(shù)據(jù)結構',55),
(3,'高數(shù)',70);
- 查詢某個表(student表)是否存在
show tables like 'student';
- 刪除表(studentscore表)
drop table studentscore;
-
left join、right join几莽、inner join
left join(左聯(lián)接) 返回包括左表中的所有記錄和右表中聯(lián)結字段相等的記錄
right join(右聯(lián)接) 返回包括右表中的所有記錄和左表中聯(lián)結字段相等的記錄
inner join(等值連接) 只返回兩個表中聯(lián)結字段相等的行
select * from student left join studentscore
on student.id=studentscore.studentid;
select * from student right join studentscore
on student.id=studentscore.studentid;
select * from student inner join studentscore
on student.id=studentscore.studentid;
- 統(tǒng)計課程及格人數(shù)
select course,sum(score>=60) as num from studentscore
group by course;