第8章泛型程序设计学习总结


第一部分:理论知识

主要内容:   什么是泛型程序设计
                   泛型类的声明及实例化的方法
                泛型方法的定义
                     泛型接口的定义
                    泛型类型的继承规则
                    通配符类型及使用方法

1:泛型类的定义
  

(1) 一个泛型类(generic class)就是具有一个或多个类型变量的类,即创建用类型作为参数的类。如一个泛型类定义格式如下:class Generics<K,V>其中的K和V是类中的可变类型参数。如:

public class Pair{
private T first;
private T second;
public Pair() {first = null; second = null;}
public Pair(T first, T second) {
this.first = first; this.second = second;
}
public T getFirst() {return first;}
public T getSecond() {return second;}
public void setFirst(T newValue)
{first = newValue;}
public void setSecond(T newValue)
{second = newValue;}
}

(2)Pair类引入了一个类型变量T,用尖括号(<>)括起来,并放在类名的后面。泛型类可以有多个类型变量。例如:public class Pair<t, u=""> { … }

(3)   类定义中的类型变量用于指定方法的返回类型以及域、局部变量的类型。

2.泛型方法的声明
(1)泛型方法
             – 除了泛型类外,还可以只单独定义一个方法作为泛型方法,用于指定方法参数或者返回值为泛型类型,留待方法调用时确定。
            – 泛型方法可以声明在泛型类中,也可以声明在普通类中。

public class ArrayTool
{
public static void insert(
E[] e, int i)
{
//请自己添加代码
}
public static E valueAt(
E[] e , int i)
{
//请自己添加代码
}
}

3.泛型接口的定义
(1)定义
public interface IPool
{
T get();
int add(T t);
}

(2)实现

public class GenericPool implements IPool
{

}

public class GenericPool implements IPool

{

}

4.泛型变量的限定
(1) 定义泛型变量的上界
public class NumberGeneric< T extends Number>
(2) 泛型变量上界的说明
 上述声明规定了NumberGeneric类所能处理的泛型变量类型需和Number有继承关系;
 extends关键字所声明的上界既可以是一个类,也可以是一个接口;
(3)< T extends  BoundingType> 表示T应该是绑定类型的子类型。  一个类型变量或通配符可以有多个限定,限定类型用“&”分割。例如:< T extends Comparable & Serializable >
(4) 定义泛型变量的下界
List cards = new ArrayList();
(5) 泛型变量下界的说明
– 通过使用super关键字可以固定泛型参数的类型为某种类型或者其超类
– 当程序希望为一个方法的参数限定类型时,通常可以使用下限通配符

public static void sort(T[] a,Comparator c)
{ …
}

5.通配符类型

通配符
– “?”符号表明参数的类型可以是任何一种类型,它和参数T的含义是有区别的。T表示一种未知类型,而“?”表示任何一种类型。这种通配符一般有以下三种用法:
    – 单独的?,用于表示任何类型。
   – ? extends type,表示带有上界。
   – ? super type,表示带有下界。


第二部分:实验部分

实验十  泛型程序设计技术

实验时间 2018-11-1

1、实验目的与要求

(1) 理解泛型概念;

(2) 掌握泛型类的定义与使用;

(3) 掌握泛型方法的声明与使用;

(4) 掌握泛型接口的定义与实现;

(5)了解泛型程序设计,理解其用途。

2、实验内容和步骤

实验1: 导入第8章示例程序,测试程序并进行代码注释。

测试程序1:

l 编辑、调试、运行教材311、312页 代码,结合程序运行结果理解程序;

l 在泛型类定义及使用代码处添加注释;

l 掌握泛型类的定义及使用。

 package pair1;

 /**
* @version 1.01 2012-01-26
* @author Cay Horstmann
*/
public class PairTest1
{
public static void main(String[] args)
{
String[] words = { "Mary", "had", "a", "little", "lamb" };
//ArrayAlg调用静态方法minmax;
Pair<String> mm = ArrayAlg.minmax(words); System.out.println("min = " + mm.getFirst());
System.out.println("max = " + mm.getSecond());
}
} class ArrayAlg
{
/**
* Gets the minimum and maximum of an array of strings.
* @param a an array of strings
* @return a pair with the min and max value, or null if a is null or empty
*/
public static Pair<String> minmax(String[] a)//定义静态泛型方法,将类型变量实例化为String;
{
if (a == null || a.length == 0) return null;
String min = a[0];
String max = a[0];
for (int i = 1; i < a.length; i++)
{
if (min.compareTo(a[i]) > 0) min = a[i];
if (max.compareTo(a[i]) < 0) max = a[i];
}
return new Pair<>(min, max);//返回一个实例化后的类对象;
}
}
 package pair1;

 /**
* @version 1.00 2004-05-10
* @author Cay Horstmann
*/
public class Pair<T> //定义泛型类,类型变量为T;
{
private T first;
private T second; public Pair() { first = null; second = null; }
// 构造泛型方法,构造方法的入口参数(first, second)类型为泛型T;
public Pair(T first, T second) { this.first = first; this.second = second; }
//定义泛型方法,类型变量T指定了访问方法的返回值和入口参数的类型;
public T getFirst() { return first; }
public T getSecond() { return second; }
//泛型方法,构造方法的入口参数类型为泛型T;
public void setFirst(T newValue) { first = newValue; }
public void setSecond(T newValue) { second = newValue; }
}

测试程序2:

l 编辑、调试运行教材315页 PairTest2,结合程序运行结果理解程序;

l 在泛型程序设计代码处添加相关注释;

l 掌握泛型方法、泛型变量限定的定义及用途。

 package pair2;

 /**
* @version 1.00 2004-05-10
* @author Cay Horstmann
*/
public class Pair<T> //定义泛型类,类型变量为T;
{
private T first;
private T second; public Pair() { first = null; second = null; }
// 构造泛型方法,构造方法的入口参数(first, second)类型为泛型T;
public Pair(T first, T second) { this.first = first; this.second = second; }
//定义泛型方法,类型变量T指定了访问方法的返回值和入口参数的类型;
public T getFirst() { return first; }
public T getSecond() { return second; }
//泛型方法,构造方法的入口参数类型为泛型T;
public void setFirst(T newValue) { first = newValue; }
public void setSecond(T newValue) { second = newValue; }
}
 package pair2;
//import PairTest1.Pair;
import java.time.*; /**
* @version 1.02 2015-06-21
* @author Cay Horstmann
*/
public class PairTest2
{
public static void main(String[] args)
{
LocalDate[] birthdays =
{
LocalDate.of(1906, 12, 9), // G. Hopper
LocalDate.of(1815, 12, 10), // A. Lovelace
LocalDate.of(1903, 12, 3), // J. von Neumann
LocalDate.of(1910, 6, 22), // K. Zuse
};
//ArrayAlg调用静态方法minmax,
Pair<LocalDate> mm = ArrayAlg.minmax(birthdays);
System.out.println("min = " + mm.getFirst());
System.out.println("max = " + mm.getSecond());
}
} class ArrayAlg
{
/**
Gets the minimum and maximum of an array of objects of type T.
@param a an array of objects of type T
@return a pair with the min and max value, or null if a is
null or empty
*/
//构造泛型方法;限定类型变量,类型变量T是Comparable类的子类,
public static <T extends Comparable> Pair<T> minmax(T[] a)
{
if (a == null || a.length == 0) return null;
T min = a[0];
T max = a[0];
for (int i = 1; i < a.length; i++)
{
if (min.compareTo(a[i]) > 0) min = a[i];
if (max.compareTo(a[i]) < 0) max = a[i];
}
return new Pair<>(min, max);//返回一个实例化泛型Pair类对象;
}
}

测试程序3:

l 用调试运行教材335页 PairTest3,结合程序运行结果理解程序;

l 了解通配符类型的定义及用途。

 package pair3;

 import java.time.*;

 public class Employee
{
private String name;
private double salary;
private LocalDate hireDay; public Employee(String name, double salary, int year, int month, int day)
{
this.name = name;
this.salary = salary;
hireDay = LocalDate.of(year, month, day);
} public String getName()
{
return name;
} public double getSalary()
{
return salary;
} public LocalDate getHireDay()
{
return hireDay;
} public void raiseSalary(double byPercent)
{
double raise = salary * byPercent / 100;
salary += raise;
}
}
 package pair3;

 public class Manager extends Employee// Manager继承父类 Employee;
{
private double bonus; /**
@param name the employee's name
@param salary the salary
@param year the hire year
@param month the hire month
@param day the hire day
*/
public Manager(String name, double salary, int year, int month, int day)
{
super(name, salary, year, month, day);
bonus = 0;
} public double getSalary()
{
double baseSalary = super.getSalary();
return baseSalary + bonus;
} public void setBonus(double b)
{
bonus = b;
} public double getBonus()
{
return bonus;
}
}
 package pair3;

 /**
* @version 1.00 2004-05-10
* @author Cay Horstmann
*/
public class Pair<T> //定义泛型类,类型变量为T;
{
private T first;
private T second; public Pair() { first = null; second = null; }
// 构造泛型方法,构造方法的入口参数(first, second)类型为泛型T;
public Pair(T first, T second) { this.first = first; this.second = second; }
//定义泛型方法,类型变量T指定了访问方法的返回值和入口参数的类型;
public T getFirst() { return first; }
public T getSecond() { return second; }
//泛型方法,构造方法的入口参数类型为泛型T;
public void setFirst(T newValue) { first = newValue; }
public void setSecond(T newValue) { second = newValue; }
}
 package pair3;

 /**
* @version 1.01 2012-01-26
* @author Cay Horstmann
*/
public class PairTest3
{
public static void main(String[] args)
{
Manager ceo = new Manager("Gus Greedy", 800000, 2003, 12, 15);
Manager cfo = new Manager("Sid Sneaky", 600000, 2003, 12, 15);
//创建Pair泛型类对象(泛型变量T默认为int型,并将其传递给类型变量T为Manager的类变量buddies;
Pair<Manager> buddies = new Pair<>(ceo, cfo);
printBuddies(buddies); ceo.setBonus(1000000);
cfo.setBonus(500000);
Manager[] managers = { ceo, cfo }; Pair<Employee> result = new Pair<>();//创建一个Pair类对象,并将其传递给类型变量T为Employee的类变量 result;
minmaxBonus(managers, result);
System.out.println("first: " + result.getFirst().getName()
+ ", second: " + result.getSecond().getName());
maxminBonus(managers, result);
System.out.println("first: " + result.getFirst().getName()
+ ", second: " + result.getSecond().getName());
} //?:下限通配符;限定类型变量的下界为Employee类;
public static void printBuddies(Pair<? extends Employee> p) {
Employee first = p.getFirst();
Employee second = p.getSecond();
System.out.println(first.getName() + " and " + second.getName() + " are buddies.");
}
//?:下限通配符;限定类型变量的下界为Manager类;
public static void minmaxBonus(Manager[] a, Pair<? super Manager> result)
{
if (a.length == 0) return;
Manager min = a[0];
Manager max = a[0];
for (int i = 1; i < a.length; i++)
{
if (min.getBonus() > a[i].getBonus()) min = a[i];
if (max.getBonus() < a[i].getBonus()) max = a[i];
}
result.setFirst(min);
result.setSecond(max);
}
//?:下限通配符;限定泛型类Pair类型变量的下界为Manager类;
public static void maxminBonus(Manager[] a, Pair<? super Manager> result)
{
minmaxBonus(a, result);
PairAlg.swapHelper(result); //swapHelper捕获通配符类型 ;
}
// 不能写: public static <T super manager> ...
} class PairAlg
{
public static boolean hasNulls(Pair<?> p)//限定泛型类Pair类型变量的下界为p;
{
return p.getFirst() == null || p.getSecond() == null;
} public static void swap(Pair<?> p) { swapHelper(p); } public static <T> void swapHelper(Pair<T> p)
{
T t = p.getFirst();
p.setFirst(p.getSecond());
p.setSecond(t);
}
}

实验2:编程练习:

编程练习1:实验九编程题总结

l 实验九编程练习1总结(从程序总体结构说明、模块说明,目前程序设计存在的困难与问题三个方面阐述)。

 package shiyan9;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner; public class Search{ private static ArrayList<Person> Personlist1;
public static void main(String[] args) { Personlist1 = new ArrayList<>(); Scanner scanner = new Scanner(System.in);
File file = new File("E:\\面向对象程序设计Java\\实验\\实验六\\身份证号.txt"); try {
FileInputStream F = new FileInputStream(file);
BufferedReader in = new BufferedReader(new InputStreamReader(F));
String temp = null;
while ((temp = in.readLine()) != null) { Scanner linescanner = new Scanner(temp); linescanner.useDelimiter(" ");
String name = linescanner.next();
String id = linescanner.next();
String sex = linescanner.next();
String age = linescanner.next();
String place =linescanner.nextLine();
Person Person = new Person();
Person.setname(name);
Person.setid(id);
Person.setsex(sex);
int a = Integer.parseInt(age);
Person.setage(a);
Person.setbirthplace(place);
Personlist1.add(Person); }
} catch (FileNotFoundException e) {
System.out.println("查找不到信息");
e.printStackTrace();
} catch (IOException e) {
System.out.println("信息读取有误");
e.printStackTrace();
}
boolean isTrue = true;
while (isTrue) {
System.out.println("******************************************");
System.out.println("1:按姓名字典顺序输出信息;");
System.out.println("2:查询最大年龄与最小年龄人员信息;");
System.out.println("3:按省份找你的同乡;");
System.out.println("4:输入你的年龄,查询年龄与你最近人的信息;");
System.out.println("5:退出");
System.out.println("******************************************");
int type = scanner.nextInt();
switch (type) {
case 1:
Collections.sort(Personlist1);
System.out.println(Personlist1.toString());
break;
case 2: int max=0,min=100;int j,k1 = 0,k2=0;
for(int i=1;i<Personlist1.size();i++)
{
j=Personlist1.get(i).getage();
if(j>max)
{
max=j;
k1=i;
}
if(j<min)
{
min=j;
k2=i;
} }
System.out.println("年龄最大:"+Personlist1.get(k1));
System.out.println("年龄最小:"+Personlist1.get(k2));
break;
case 3:
System.out.println("place?");
String find = scanner.next();
String place=find.substring(0,3);
String place2=find.substring(0,3);
for (int i = 0; i <Personlist1.size(); i++)
{
if(Personlist1.get(i).getbirthplace().substring(1,4).equals(place))
{
System.out.println("你的同乡:"+Personlist1.get(i));
}
} break;
case 4:
System.out.println("年龄:");
int yourage = scanner.nextInt();
int close=ageclose(yourage);
int d_value=yourage-Personlist1.get(close).getage();
System.out.println(""+Personlist1.get(close)); break;
case 5:
isTrue = false;
System.out.println("再见!");
break;
default:
System.out.println("输入有误");
}
}
}
public static int ageclose(int age) {
int m=0;
int max=53;
int d_value=0;
int k=0;
for (int i = 0; i < Personlist1.size(); i++)
{
d_value=Personlist1.get(i).getage()-age;
if(d_value<0) d_value=-d_value;
if (d_value<max)
{
max=d_value;
k=i;
} } return k; } }

Search

 package shiyan9;

 public class Person implements Comparable<Person> {
private String name;
private String id;
private int age;
private String sex;
private String birthplace; public String getname() {
return name;
}
public void setname(String name) {
this.name = name;
}
public String getid() {
return id;
}
public void setid(String id) {
this.id= id;
}
public int getage() { return age;
}
public void setage(int age) {
// int a = Integer.parseInt(age);
this.age= age;
}
public String getsex() {
return sex;
}
public void setsex(String sex) {
this.sex= sex;
}
public String getbirthplace() {
return birthplace;
}
public void setbirthplace(String birthplace) {
this.birthplace= birthplace;
} public int compareTo(Person o) {
return this.name.compareTo(o.getname()); } public String toString() {
return name+"\t"+sex+"\t"+age+"\t"+id+"\t"; } }

Person

 

(1)编程练习1总结:

程序总体结构:主类(Search)和接口(Person);

模块说明:(1)主类Search:读取文件模块;

Try/catch模块:监视可能出现的异常;捕捉处理异常;

Switch/case模块匹配选择5种具体操作;

(2)接口(Person):

                       属性声明模块;

                   构造方法模块:getname,setname, getid,setid,getage,setage,getsex,setsex,getbirthplace,setbirthplace,compareTo等;

目前存在的困难与问题:    文件读取路径的设置影响到能否找到文件;

          不论是语法,还是主要的技术(如接口)方面不是娴熟,有些显而易见的东西不能立马想到;

          构想正确的设计思路;

l 实验九编程练习2总结(从程序总体结构说明、模块说明,目前程序设计存在的困难与问题三个方面阐述)。

 package a;

 import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner; import org.w3c.dom.css.Counter; public class Main{
public static void main(String[] args) { Scanner in = new Scanner(System.in);
counter counter=new counter();
PrintWriter output = null;
try {
output = new PrintWriter("result.txt");
} catch (Exception e) {
//e.printStackTrace();
}
int sum = 0; for (int i = 1; i < 11; i++) {
int a = (int) Math.round(Math.random() * 100);
int b = (int) Math.round(Math.random() * 100);
int type = (int) Math.round(Math.random() * 4); switch(type)
{
case 1:
System.out.println(i+": "+a+"/"+b+"=");
while(b==0){
b = (int) Math.round(Math.random() * 100);
}
double c = in.nextDouble();
output.println(a+"/"+b+"="+c);
if (c == counter.Chu(a, b))
{
sum += 10;
System.out.println("恭喜答案正确!");
}
else {
System.out.println("答案错误!");
} break; case 2:
System.out.println(i+": "+a+"*"+b+"=");
int c1 = in.nextInt();
output.println(a+"*"+b+"="+c1);
if (c1 == counter.Cheng(a, b)) {
sum += 10;
System.out.println("恭喜答案正确!");
}
else {
System.out.println("答案错误!");
}break;
case 3:
System.out.println(i+": "+a+"+"+b+"=");
int c2 = in.nextInt();
output.println(a+"+"+b+"="+c2);
if (c2 == counter.Jia(a, b)) {
sum += 10;
System.out.println("恭喜答案正确!");
}
else {
System.out.println("答案错误!");
}break ;
case 4:
System.out.println(i+": "+a+"-"+b+"=");
int c3 = in.nextInt();
output.println(a+"-"+b+"="+c3);
if (c3 == counter.Jian(a, b)) {
sum += 10;
System.out.println("恭喜答案正确!");
}
else {
System.out.println("答案错误!");
}break ; } }
System.out.println("成绩"+sum);
output.println("成绩:"+sum);
output.close(); }
}

Main

 package a;

 public class counter {
private int a;
private int b; public int Jia(int a,int b)
{
return a+b;
}
public int Jian(int a,int b)
{
if((a-b)<0)
return 0;
else
return a-b;
}
public int Cheng(int a,int b)
{
return a*b;
}
public int Chu(int a,int b)
{
if(b!=0)
return a/b;
else
return 0;
} }

counter

编程练习2总结:

程序结构:主类Main和子类counter两大部分;

模块说明:Main类:

(1) 建文件字符流,文件输出模块,将out结果输出到result.txt中;

(2)  try/catch模块捕获处理异常;

(3)  Switch//case模块:随机生成a,b两个操作数,匹配选择加减乘除四种具体操作;

(4)  输出总成绩;

子类counter类:

(1) 属性声明;

(2) 构造方法;

程序设计存在的困难与问题:
                           1.没有全面考虑小学生的实际状况:减法算法结果可能出现负数的情况,以及除法的运算结果直接取整输出,都不符合小学生的学习范围;
                           2.编程过程中,我在变量的 使用范围中出现了问题;
                           3.结果输出到文件中;

     4.设计思路比较难;                                              

编程练习2:采用泛型程序设计技术改进实验九编程练习2,使之可处理实数四则运算,其他要求不变。

 package a;

 import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner; //import org.w3c.dom.css.Counter; public class Main{
public static void main(String[] args) { Scanner in = new Scanner(System.in);
counter Counter=new counter();
PrintWriter output = null;
try {
output = new PrintWriter("result.txt");
} catch (Exception e) {
//e.printStackTrace();
}
int sum = 0; for (int i = 1; i <=10; i++) {
int a = (int) Math.round(Math.random() * 100);
int b = (int) Math.round(Math.random() * 100);
int type = (int) Math.round(Math.random() * 4); switch(type)
{
case 1: System.out.println(i+": "+a+"/"+b+"=");
while(b== 0&& a%b!=0)
{
b = (int) Math.round(Math.random() * 100);
a = (int) Math.round(Math.random() * 100);
} int c = in.nextInt();
output.println(a+"/"+b+"="+c);
if (c == Counter.Chu(a, b))
{
sum += 10;
System.out.println("恭喜答案正确!");
}
else {
System.out.println("答案错误!");
}
break; case 2:
System.out.println(i+": "+a+"*"+b+"=");
int c1 = in.nextInt();
output.println(a+"*"+b+"="+c1);
if (c1 == Counter.Cheng(a, b)) {
sum += 10;
System.out.println("恭喜答案正确!");
}
else {
System.out.println("答案错误!");
}
break;
case 3:
System.out.println(i+": "+a+"+"+b+"=");
int c2 = in.nextInt();
output.println(a+"+"+b+"="+c2); if (c2 == Counter.Jia(a, b)) {
sum += 10;
System.out.println("恭喜答案正确!");
}
else {
System.out.println("答案错误!");
}
break ; case 4: while (a < b) {
int x=0;
x=b;
b=a;
a=x;
}
System.out.println(i+": "+a+"-"+b+"=");
int c3 = in.nextInt();
output.println(a+"-"+b+"="+c3);
if (c3 == Counter.Jian(a, b))
{
sum += 10;
System.out.println("恭喜答案正确!");
}
else {
System.out.println("答案错误!");
}
break ; } }
System.out.println("成绩"+sum);
output.println("成绩:"+sum);
output.close(); }
}
 package a;

 public class counter<T>{
private T a;
private T b; public counter(T a, T b) {
this.a = a;
this.b = b;
} public counter() {
// TODO Auto-generated constructor stub
} public int Jia(int a,int b)
{
return a+b;
}
public int Jian(int a,int b)
{
return a-b; }
public int Cheng(int a,int b)
{
return a*b;
}
public int Chu(int a,int b)
{
if (b!= 0 && a%b==0)
return a / b;
else
return 0; } }

主要是对于除法和减法的修改,过滤掉一些不合适的数据;


第三部分:总结

1.上泛型理论课的时候,我以为我掌握的差不多了,用的时候还是多多少少有这样那样的问题,可能有些操作我没练习过也就没发现一些隐藏的问题和疑惑。

    2.之前读代码,敲代码的时候虽然会总结,但一直不怎么重视反思总结,但这次这么仔细的,以老师给的这种步骤去重新审视总结,感觉很不错,也积累了一种学习方法;

    3.拿到一个问题后的解决思路是非常重要的!!!

201771010134杨其菊《面向对象程序设计java》第十周学习总结的更多相关文章

  1. 201771010134杨其菊《面向对象程序设计java》第九周学习总结

                                                                      第九周学习总结 第一部分:理论知识 异常.断言和调试.日志 1.捕获 ...

  2. 201871010132-张潇潇《面向对象程序设计(java)》第一周学习总结

    面向对象程序设计(Java) 博文正文开头 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cn ...

  3. 扎西平措 201571030332《面向对象程序设计 Java 》第一周学习总结

    <面向对象程序设计(java)>第一周学习总结 正文开头: 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 ...

  4. 杨其菊201771010134《面向对象程序设计Java》第二周学习总结

    第三章 Java基本程序设计结构 第一部分:(理论知识部分) 本章主要学习:基本内容:数据类型:变量:运算符:类型转换,字符串,输入输出,控制流程,大数值以及数组. 1.基本概念: 1)标识符:由字母 ...

  5. 201871010124 王生涛《面向对象程序设计JAVA》第一周学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://edu.cnblogs.com/campus/xbsf/ ...

  6. 201871010115——马北《面向对象程序设计JAVA》第二周学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p ...

  7. 201777010217-金云馨《面向对象程序设计(Java)》第二周学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p ...

  8. 201871010132——张潇潇《面向对象程序设计JAVA》第二周学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.com/nwnu-daizh/p ...

  9. 201771010123汪慧和《面向对象程序设计Java》第二周学习总结

    一.理论知识部分 1.标识符由字母.下划线.美元符号和数字组成, 且第一个符号不能为数字.标识符可用作: 类名.变量名.方法名.数组名.文件名等.第二部分:理论知识学习部分 2.关键字就是Java语言 ...

  10. 20155303 2016-2017-2 《Java程序设计》第十周学习总结

    20155303 2016-2017-2 <Java程序设计>第十周学习总结 目录 学习内容总结 网络编程 数据库 教材学习中的问题和解决过程 代码调试中的问题和解决过程 代码托管 上周考 ...

随机推荐

  1. An error occurred while starting the application.

    一..net core 发布后的站点启动报错如下 An error occurred while starting the application. .NET Core 4.6.26328.01 X6 ...

  2. 关于Hibernate和Strtus2的xml提示问题

    话不多说,上图 1.Windom 2.preferences 3.搜索框搜索xml catalog 点击Add 4.导入约束(具体操作图上1.2.3)

  3. redis锁机制介绍与实例

    转自:https://m.jb51.net/article/154421.htm 今天小编就为大家分享一篇关于redis锁机制介绍与实例,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要 ...

  4. LevelDB源码分析-Write

    Write LevelDB提供了write和put两个接口进行插入操作,但是put实际上是调用write实现的,所以我在这里只分析write函数: Status DBImpl::Write(const ...

  5. 本地jar包添加至Maven仓库

    Maven命令将本地的jar包方放到maven仓库中 //自定义本地的jar包在pom文件的参数 <dependency> <groupId>com.eee</group ...

  6. docker的安装和简单配置

    docker的安装和简单配置 docker是balabalabala...懒得介绍. 国内安装docker很蛋疼,按照官方配置好了软件源之后,几十MB的安装文件下载要半天,没办法,docker默认的软 ...

  7. c3p0数据源的第一次尝试

    开始补习 以前学习过的基础 正在尝试从c3p0 获取到connection 好的,首先上代码吧 public static DataSource ds = null; static { ComboPo ...

  8. 需要重写URL但请求的目录不存在报404

    用的是asp.net webform,在global.asax的application_beginrequest中写的代码 很简单的一个需求,在url中输入http://www.test.com/lc ...

  9. office2016产品密钥

    office2016专业增强版产品密钥: VL批量授权版:QCKNG-29MKJ-74G4B-X7DT8-JFHBB(亲测有效) office2016专业增强版密钥(Retail零售版),可电话激活 ...

  10. Mysql优化策略

    总的来说:1.数据库设计和表创建时就要考虑性能 2.sql的编写需要注意优化 3.分区.分表.分库 设计表的时候: 1.字段避免null值出现,null值很难查询优化且占用额外的索引空间,推荐默认数字 ...