Java集合和泛型練習及面試題——博客園:師妹開講啦

給定一段JAVA代碼如下:要打印出list中存儲的內容,以下語句正確的是(?B??)

ArrayList?list?=?new?ArrayList(?)??

list.add(“a”)??

list.add(“b”)??

Iterator?it?=?list.iterator(?)?

A.while(it.?Next(?)?)?  system.out.println(it.next(?)?)

B.for(int?i=0;?i<list.size(?)??i++)?  system.out.println(list.get(i))??

C.while(list.hasNext(?)?)?  system.out.println(list.next(?)?)?

D.for(int?i=0;?i<list.size(?)??i++)?  system.out.println(it(i))??

下面代碼運行結果正確的是(C?)--博客園:師妹開講啦

?import?java.util.*;?

public?class?TestListSet{?

  public?static?void?main(String?args[]){?

    List?list?=?new?ArrayList();?

    list.add(“Hello”);

    list.add(“Learn”);

    ?list.add(“Hello”);

    ?list.add(“Welcome”);

    Set?set?=?new?HashSet();?

    set.addAll(list);?

    System.out.println(set.size());?

  }?

}??

A.編譯不通過                   B.編譯通過,運行時異常  

C.編譯運行都正常,//輸出HashSet中不能放重復值  D.編譯運行都正常,輸出4

在java中,(?B)接口位于集合框架的頂層

A.Map  B.Collection  C.Set  D.List

在JAVA中,以下(?C?)類的對象以鍵-值的方式存儲對象

A.java.util.List?  B.java.util.ArrayList  C.java.util.HashMap  D.java.util.LinkedList

在JAVA中ArrayList類實現了可變大小的數組,便于遍歷元素和隨機訪問元素,已知獲得了ArrayList類的對象bookTypeList,則下列語句中能夠實現判斷列表中是否存在字符串“小說”的是(C?)

A.bookTypeList.add("小說");?      B.bookTypeList.get("小說");?

C.bookTypeList.contains("小說");?  ?? D.bookTypeList.remove("小說");?

下面敘述哪些是正確的?(ABC??)

A.java中的集合類(如Vector)可以用來存儲任何類型的對象,且大小可以自動調整。但需要事先知道所存儲對象的類型,才能正常使用

B.在java中,可以用異常(Exception)來拋出一些并非錯誤的消息,但這樣比直接從函數返回一個結果要花費更大的系統開銷。

C.java接口包含函數聲明和常量聲明。

D.java中,子類不可以訪問父類的私有成員和受保護的成員

在JAVA中,LinkedList類和ArrayList類同屬于集合框架類,下列(ABC?)選項中的方法是LinkedList類ArrayList類都有的

A.add(Object?o)  B.add(int?index,Object?o)  C.remove(Object?o)?  D.removeLast()

請分析下面程序編譯并運行的結果

class MyNumberException<T> extends Exception{

  public MyNumberException(String message){

    super(message);

  }

}

public class GenericsTest{

  public static void main(String[] args){

    int num=1;

    try{

      if(num<10){

        throw new MyNumberException("數字小于10");

      }

    }catch(MyNumberException e){

      System.out.println(e);

    }catch(Exception e){

      System.out.println(e);

    }

  }

}

解析:在Java中泛型類繼承Throwable及其子類都是不合法的,所以上面的程序編譯無法通過

已知:--博客園:師妹開講啦

public class ListTest{

  public static void main(String[] args){

    LinkedList<String> link=new LinkedList<String>();

    link.add("1");

    link.add("2");

    link.add("3");

    link.addFirst("F");

    link.addLast("L");

    for(int i=0;i<link.size();i++){

      link.remove(i);

    }

    System.out.println(link);

  }

}

程序運行結果:[1,3]

解析:添加完元素后,集合中的元素順序為[F,1,2,3,L],各個元素對應索引位置為0,1,2,3,4 執行第一次循環,i=0,刪除F,集合變為[1,2,3,L],各個元素對應的索引位置為0,1,2,3 ? 執行第二次循環:i=1,刪除2,集合變為[1,3,L],各個元素對應的索引位置為0,1,2 ?執行第三次循環:i=2,刪除L,集合變為[1,3],各個元素對應的索引位置為0,1 所以程序結束,結果為[1,3]

利用Map,完成下面的功能:

?從命令行讀入一個字符串,表示一個年份,輸出該年的世界杯冠軍是哪支球隊。如果該年沒有舉辦世界杯,則輸出:沒有舉辦世界杯。

?附:世界杯冠軍以及對應的奪冠年份--博客園:師妹開講啦

public?class?Bk?{

  public?static?void?main(String[]?args)?{?

    BufferedReader?br=new?BufferedReader(new?InputStreamReader(System.in));?

    String?year=null;?

?    try?{?

      year=br.readLine();??

    }?catch?(IOException?e)?{??

      e.printStackTrace();??

    }

    Map<String,String>?map=new?HashMap<String,?String>();??

    map.put("2002",?"巴西");?

    map.put("2006",?"意大利");?

    map.put("2010","南非");??

    if(map.containsKey(year)){??

      System.out.println(map.get(year));??

    }??

    else{?

      System.out.println("這一年沒有承辦世界杯!");??

    }?

  }???

}

完善下列代碼,實現List?中的內容放到一個Map?中,該Map?的鍵為id值為相應的Account?對象。最后遍歷這個Map,打印所有Account?對象的id?和余額

public class Test{

  public static void main(String[] args) {

    List list=new ArrayList();

    list.add(new Account(10.00,"1234"));

    list.add(new Account(15.00,"5678"));

    list.add(new Account(0.0,"1010"));

    Map map=new HashMap();

    for(int i=0;i<list.size();i++){

      Account account=(Account)list.get(i);

      map.put(account.getId(), account);

    }

    Set<Map.Entry<Long,Object>> set=map.entrySet();

    for(Map.Entry<Long, Object> obj:set){

      Account acc=(Account)obj.getValue();

      System.out.println(obj.getKey()+"/"+acc.getBalance());

    }

  }

}

class Account{

  private long id;

  private double balance;

  private String password;

  public Account(){}

  public Account(double balance,String password){

    this.id=new Random().nextLong();

    this.balance=balance;

    this.password=password;

  }

  public long getId() {

    return id;

  }

  public void setId(long id) {

    this.id = id;

  }

  public double getBalance() {

    return balance;

  }

  public void setBalance(double balance) {

    this.balance = balance;

  }

  public String getPassword() {

    return password;

  }

  public void setPassword(String password) {

    this.password = password;

  }

}

寫出下面程序的輸出結果

import?java.util.*;?

class?MyClass{?

  int?value;?

  public?MyClass(){}?

  public?MyClass(int?value){?

    this.value?=?value;?

  }?

  public?String?toString(){?

    return?value;

  }?

}?

public?class?TestList{?

  public?static?void?main(String?args[]){?

    MyClass?mc1?=?new?MyClass(10);?

    MyClass?mc2?=?new?MyClass(20);

    MyClass?mc3?=?new?MyClass(30);?

    List?list?=?new?ArrayList();?

    list.add(mc1);?

    list.add(mc2);?

    list.add(mc3);?

    MyClass?mc4?=?(MyClass)?list.get(1);

    //MyClass?mc4=(MyClass)mc2;?

    mc4.value?=?50;?

    for(int?i?=?0;?i<list.size();?i++){?

      System.out.println(list.get(i));?

    }?

  }?

}

程序運行結果:

10

50

30

使用HashMap完成學生信息的管理功能,主要功能包括:添加學生數據、打印學生名單、刪除學生數據、按學號查詢學生信息四個功能。并實現持久化保存--博客園:師妹開講啦

//Java序列化是指把Java對象轉換為字節序列的過程;而Java反序列化是指把字節序列恢復為Java對象的過程

public class Student implements Serializable{

private static final long serialVersionUID = 1L;

private String sno;

private String name;

private String gender;

private int age;

public Student(String sno,String name,String gender,int age){

super();

this.sno=sno;

this.name=name;

this.gender=gender;

this.age=age;

}

public String getSno() {

return sno;

}

public void setSno(String sno) {

this.sno = sno;

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public String getGender() {

return gender;

}

public void setGender(String gender) {

this.gender = gender;

}

public int getAge() {

return age;

}

public void setAge(int age) {

this.age = age;

}

public String toString(){

return sno+"\t"+name+"\t"+gender+"\t"+age;

}

}

?

public interface DAOStudent {

public boolean saveAll(HashMap<String, Student> students);

public HashMap<String, Student> getAll();

}

?

public class ImplDAOStudent implements DAOStudent{

@Override

public HashMap<String, Student> getAll() {

HashMap<String,Student> hm=new HashMap<String, Student>();

File file=new File("student.txt");

ObjectInputStream ois=null;

try{

ois=new ObjectInputStream(new FileInputStream(file));

if(file.length()!=0){

hm=(HashMap<String, Student>)ois.readObject();

}

ois.close();

}catch(Exception e){

e.printStackTrace();

}

return hm;

}

@Override

public boolean saveAll(HashMap<String, Student> students){

File file=new File("student.txt");

long l=file.length();

ObjectOutputStream oos=null;

try{

oos=new ObjectOutputStream(new FileOutputStream(file));

oos.writeObject(students);

oos.close();

}catch(Exception e){

e.printStackTrace();

}

if(file.length()>l){

return true;

}

else {

return false;

}

}

}

?

public class StudentControl {

private static DAOStudent DAOstu=new ImplDAOStudent();

private static HashMap<String,Student> students;

public ?static StudentControl st=new StudentControl();

static{

students=DAOstu.getAll();

}

private StudentControl(){}

public static StudentControl getInstance(){

return st;

}

public boolean addStudent(Student s){

if(!students.containsKey(s.getSno())){

students.put(s.getSno(), s);

return true;

}else{

return false;

}

}

public ArrayList<Student> getAll(){

ArrayList<Student> al=new ArrayList<Student>();

Set<Map.Entry<String, Student>> set=students.entrySet();

Iterator<Map.Entry<String,Student>> it=set.iterator();

while(it.hasNext()){

Map.Entry<String,Student> entry= it.next();

Student stu=entry.getValue();

al.add(stu);

}

return al;

}

public boolean deleteStudent(String sno){

if(students.containsKey(sno)){

students.remove(sno);

return true;

}else{

return false;

}

}

public Student queryStudentBySno(String sno){

if(students.containsKey(sno)){

return students.get(sno);

}else

return null;

}

public boolean exitSystem(){

return DAOstu.saveAll(students);

}

}

?

public class ViewStudent {

public void menu(){

System.out.println("*********************");

System.out.println("請選擇需要的功能:");

System.out.println("1.添加學生數據");

System.out.println("2.打印學生名單");

System.out.println("3.刪除學生數據");

System.out.println("4.打印對應學號的學生數據");

System.out.println("0.退出系統");

System.out.println("**********************");

}

}

?

public class ManageStudent{

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);

StudentControl sco=StudentControl.getInstance();

while(true){

new ViewStudent().menu();

int count=sc.nextInt();

switch(count){

case 1: System.out.println("請輸入學生信息:");

System.out.print("姓名:");

String name=sc.next();

System.out.print("學號:");

String sno=sc.next();

System.out.print("性別:");

String gender=sc.next();

System.out.print("年齡:");

int age=sc.nextInt();

Student student=new Student(sno,name,gender,age);

if(sco.addStudent(student)){

System.out.println("操作成功");

}else{

System.out.println("操作失敗");

}

break;

case 2:

System.out.println("學號\t\t姓名\t性別\t年齡");

ArrayList<Student> list=sco.getAll();

Iterator<Student> it=list.iterator();

while(it.hasNext()){

Student stu=it.next();

System.out.println(stu.toString());

}

break;

case 3:System.out.println("請輸入需要刪除的學生的學號:");

String string=sc.next();

if(sco.deleteStudent(string)){

System.out.println("操作成功");

}else{

System.out.println("操作失敗");

}

break;

case 4:System.out.println("輸入你要查找的學號:");

String str=sc.next();

Student stu=sco.queryStudentBySno(str);

System.out.println("學號\t\t姓名\t性別\t年齡");

System.out.println(stu.toString());

break;

case 0:

sco.exitSystem();

System.exit(0);

default:System.out.println("輸入有誤,請重新輸入");

}

}

}

}

?

輸入學生信息,按學生成績排序

public class Stu{

private String name;

private int score;

public Stu(){}

public Stu(String name,int score){

this.name=name;

this.score=score;

}

public String getName() {

return name;

}

public void setName(String name) {

this.name = name;

}

public int getScore() {

return score;

}

public void setScore(int score) {

this.score = score;

}

public String toString(){

return name+":"+score;

}

}

?

public class CompareScore implements Comparator<Stu>{

public boolean equals(Object obj){

return super.equals(obj);

}

@Override

public int compare(Stu s1, Stu s2) {

if(s1.getScore()>s2.getScore()){

return -1;

}else if(s1.getScore()<s2.getScore()){

return 1;

}else{

return s2.getName().compareTo(s1.getName());

}

}

}

?

public class DemoTreeSet {

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);

TreeSet<Stu> ts=new TreeSet<Stu>(new CompareScore());

while(true){

System.out.print("給出你的選擇(1.添加信息、2.降序輸出、3.退出程序)");

int num=sc.nextInt();

switch(num){

case 1:

System.out.print("輸入學生的姓名:");

String name=sc.next();

System.out.print("輸入學生的成績:");

int score=sc.nextInt();

ts.add(new Stu(name,score));

break;

case 2:System.out.println(ts);

break;

case 0:System.exit(0);

default:System.out.println("輸入有誤,請重新輸入");

}

}

}

}

?

使用泛型得到數組的最大和最小值

interface MaxOrMin<T extends Comparable<T>>{

T min(T[] t);

T max(T[] t);

}

public class TextMinOrMax {

public static void main(String[] args) {

Integer[] in=new Integer[]{43,52,66,71,39,33};

Character[] ch=new Character[]{'f','v','d','t','z'};

ComparableElement<Integer> ce1=new ComparableElement<Integer>();

System.out.println("int數組的最大值:"+ce1.max(in)+",最小值:"+ce1.min(in));

ComparableElement<Character> ce2=new ComparableElement<Character>();

System.out.println("char數組的最大值:"+ce2.max(ch)+",最小值:"+ce2.min(ch));

}

}

class ComparableElement<T extends Comparable<T>> implements MaxOrMin<T>{

T max;

T min;

@Override

public T max(T[] t) {

?max=t[0];

?for(int i=0;i<t.length;i++){

?if(max.compareTo(t[i])<0){

?max=t[i];

?}

?}

return max;

}

@Override

public T min(T[] t) {

?min=t[0];

?for(int i=0;i<t.length;i++){

?if(min.compareTo(t[i])>0){

?min=t[i];

?}

?}

return min;

}

}

IteratorListIterator有什么區別?

Iterator:只能正向遍歷集合,適用于獲取移除元素。ListIerator:繼承Iterator,可以雙向列表的遍歷,同樣支持元素的修改。

Collection和Collections的區別

答:Collection:是java.util包中的接口,是集合類的基本接口,主要的子接口有List和Set

Collections:是java.util包中的類,是針對集合的一個實用工具類,它包含了對各種集合的搜索、排序和線程安全等一系列的靜態方法。

ArrayList與Vector的異同--博客園:師妹開講啦

答:相同點:ArrayList和Vector都是List的子類,都是有序的集合,可以存儲相同的元素,相當于動態數組,他們都可以按索引位置取得指定的元素。

區別:(1)出現的時間:Vector是在JDK1.0就已存在,而ArrayList到了JDK1.2才推出。

(2)同步性:Vector是線程安全的,也就是說它的方法之間是線程同步的,而ArrayList是線程不安全的,它的方法之間是線程不同步的。在程序設計中,如果是只有一個線程會訪問到集合,最好選擇使用ArrayList,因為他不考慮線程安全,效率會高些;如果多個線程會訪問到集合,最好選擇使用Vector,因為不需要開發人員自己編寫線程安全的代碼。

(3)數據增長:ArrayList與Vector都存在初始的容量大小,且都為10,當存儲進集合里的元素的個數超過了容量時,就需要增加ArrayList與Vector的存儲空間。每次要增加存儲空間時,不是只增加一個存儲單元,而是增加多個存儲單元。這就要求每次增加的存儲單元的個數在內存空間利用與線程效率之間要取得一定的平衡。Vector默認增長為原來一倍,而ArrayList的增長策略在文檔中沒有明確規定(從源代碼看到的是增長為原來的一半)

(4)輸出方式:Vector可以使用Iterator、foreach和Enumeration方式輸出,而ArrayList只能使用Iterator、foreach方式輸出

簡述HashMap與Hashtable的異同--博客園:師妹開講啦

答:相同點:HashMap與Hashtable都是Map接口的實現類,而HashMap是Hashtable的輕量級實現(非線程安全的實現)。兩者都是用key-value方式獲取數據。

區別:(1)出現的時間:Hashtable在JDK1.0時出現,屬于舊的操作類,而HashMap是在JDK1.2時推出的類,屬于較新的操作類

(2)同步性:Hashtable是線程安全的,也就是說是同步的,性能相對較低,而HashMap是線程不安全的,不是同步的,性能相對較高。

(3)值:Hashtable不允許存放null值和null鍵,而HashMap允許存在一個null鍵和多個null值

(4)HashMap沒法保證映射的順序一直不變,但是作為HashMap的子類LinkedHashMap,如果想要預知的順序迭代(默認按照插入順序),你可以很輕易的置換為HashMap,如果使用Hashtable就沒那么容易了。

(5)迭代HashMap采用快速失敗機制,而Hashtable不是,所以這是設計的考慮點

ArrayList中的淺拷貝與深拷貝

淺拷貝:被復制對象的所有變量都含有與原來的對象相同的值,而所有的對其他對象的引用仍然指向原來的對象。換言之,淺復制僅僅復制所考慮的對象,而不復制它所引用的對象。??

深拷貝:被復制對象的所有變量都含有與原來的對象相同的值,除去那些引用其他對象的變量。那些引用其他對象的變量將指向被復制過的新對象,而不再是原有的那些被引用的對象。換言之,深復制把要復制的對象所引用的對象都復制了一遍.(eg:??1、直接賦值(字符串外都屬于淺拷貝)??2、使用構造函數(深拷貝)??3、使用clone()方法(深拷貝)??)

ArrayList中為何加transient關鍵字?

?? transient是Java語言的關鍵字,變量修飾符,如果用transient聲明一個實例變量,當對象存儲時,它的值不需要維持。這里的對象存儲是指,Java的serialization提供的一種持久化對象實例的機制。當一個對象被序列化的時候,transient型變量的值不包括在序列化的表示中,然而非transient型的變量是被包括進去的。使用情況是:當持久化對象時,可能有一個特殊的對象數據成員,我們不想用serialization機制來保存它。為了在一個特定對象的一個域上關閉serialization,可以在這個域前加上關鍵字transient。

Java中的泛型是什么 ? 使用泛型的好處是什么?

泛型的本質是參數化類型,也就是說所操作的數據類型被指定為一個參數。這種參數類型可以用在類、接口和方法的創建中,分別稱為泛型類、泛型接口、泛型方法。 泛型的好處是在編譯的時候檢查類型安全,并且所有的強制轉換都是自動和隱式的,提高代碼的重用率。

Java的泛型是如何工作的 ? 什么是類型擦除

Java中的泛型基本上都是在編譯器這個層次來實現的。在生成的Java字節碼中是不包含泛型中的類型信息的。使用泛型的時候加上的類型參數,會在編譯器在編譯的時候去掉。這個過程就稱為類型擦除。

請舉例說明static和泛型的沖突所在

泛型類確定T的類型實在運行是時期,而static在編譯時期已經存在。

?

?

轉載于:https://www.cnblogs.com/xiaoshimei/p/6230735.html

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/284962.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/284962.shtml
英文地址,請注明出處:http://en.pswp.cn/news/284962.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

對于經常需要truncate的表進行固定統計信息

為什么80%的碼農都做不了架構師&#xff1f;>>> 大家做過統計的一些存儲過程可能會知道&#xff0c;我們經常有這類表&#xff0c;要先truncate它&#xff0c;執行插入&#xff0c;再在執行相關sql&#xff0c;這就會導致有一個時間誤差&#xff0c;如果在truncate…

ArcGIS實驗教程——實驗四十一:ArcGIS區域分析統計直方圖(土地利用--坡度分級柱狀統計圖的制作)

文章目錄 一、任務描述二、實驗數據三、實驗過程一、任務描述 在實際工作中,通常需要統計不同類型的土地利用數據與坡度的關系。本實驗中以土地利用landuse和數字高程模型dem數據為例,基于ArcGIS平臺,統計了村莊、風景名勝、林地、草地、旱地等多種類型土地利用數據所占用的…

[轉]圖片格式WEBP全面解析

前言 不管是 PC 還是移動端&#xff0c;圖片一直是流量大頭&#xff0c;以蘋果公司 Retina 產品為代表的高 PPI 屏對圖片的質量提出了更高的要求&#xff0c;如何保證在圖片的精細度不降低的前提下縮小圖片體積&#xff0c;成為了一個有價值且值得探索的事情。 但如今對于 JP…

C語言試題189之編寫一個程序,按照下圖中的樣子創建數據結構,最后三個對象都是動態分配的結構。第一個對象則可能是一個靜態的指向結構的指針

??個人主頁:個人主頁 ??系列專欄:C語言試題200例 ??推薦一款刷算法、筆試、面經、拿大公司offer神器?? 點擊跳轉進入網站 ?作者簡介:大家好,我是碼莎拉蒂,CSDN博客專家(全站排名Top 50),阿里云博客專家、51CTO博客專家、華為云享專家 1、題目 題目: 編寫一…

基于.NetCore開發博客項目 StarBlog - (15) 生成隨機尺寸圖片

系列文章基于.NetCore開發博客項目 StarBlog - (1) 為什么需要自己寫一個博客&#xff1f;基于.NetCore開發博客項目 StarBlog - (2) 環境準備和創建項目基于.NetCore開發博客項目 StarBlog - (3) 模型設計基于.NetCore開發博客項目 StarBlog - (4) markdown博客批量導入基于.N…

【初探移動前端開發03】jQuery Mobile(上)

前言到目前為止&#xff0c;我打了幾天醬油了&#xff0c;這幾天落實了工作&#xff0c;并且看了一部電視連續劇&#xff08;陳道明-手機&#xff09;&#xff0c;我很少看連續劇了&#xff0c;但是手機質量很高啊&#xff0c;各位可以看看。我們今天先學習一下jquery mobile的…

Git Bash的一些命令和配置

查看git版本號&#xff1a; git --version 如果是第一次使用Git&#xff0c;你需要設置署名和郵箱&#xff1a; $ git config --global user.name "用戶名" $ git config --global user.email "電子郵箱" 檢查你的設置 $ git config --list 或單獨檢查一項…

/dev/null 文件

/dev/null 文件 如果希望執行某個命令&#xff0c;但又不希望在屏幕上顯示輸出結果&#xff0c;那么可以將輸出重定向到 /dev/null&#xff1a; $ command > /dev/null /dev/null 是一個特殊的文件&#xff0c;寫入到它的內容都會被丟棄&#xff1b;如果嘗試從該文件讀取內容…

C語言試題190之實現函數在第一個參數中進行查找,并返回匹配第二個參數所包含的字符的數目

??個人主頁:個人主頁 ??系列專欄:C語言試題200例 ??推薦一款刷算法、筆試、面經、拿大公司offer神器?? 點擊跳轉進入網站 ?作者簡介:大家好,我是碼莎拉蒂,CSDN博客專家(全站排名Top 50),阿里云博客專家、51CTO博客專家、華為云享專家 1、題目 題目: 實現函…

強大的多列 IN 查詢語句,及數據庫支持情況。

SQL 中最強大的也是最復雜的就是查詢部分。在需要查詢多條記錄時我們一般會采用 in 關鍵字來指定要查詢的條件&#xff1a;SELECT * FROM t_user WHERE uid IN (1,2,3,4,5,6,7,8,9);但如果對應的數據需要兩個或更多字段才能確定&#xff0c;可能會寫出以下的 SQL 語句&#xff…

ArcGIS實驗教程——實驗四十二:ArcGIS密度分析(核密度、點密度、線密度)

文章目錄 一、密度分析原理二、點密度分析三、線密度分析四、核密度分析一、密度分析原理 密度分析是指根據輸入的要素數據集計算整個區域的數據聚集狀況,從而產生一個聯系的密度表面。通過密度計算,將每個采樣點的值散步到整個研究區域,并獲得輸出柵格中每個像元的密度值。…

Log4Net的WebApplication使用

一、Log4Net的WebApplication使用 1、首先使用nuget 添加log4Net 到WebApplication項目中 log4j每個符號的具體含義&#xff1a;%d %5p %c{1}:%L - %m%n log4j.properties# %m 輸出代碼中指定的消息# %p 輸出優先級&#xff0c;即DEBUG&#xff0c;INFO&#xff0c;WARN&…

C語言試題191之實現strcat函數功能

??個人主頁:個人主頁 ??系列專欄:C語言試題200例 ??推薦一款刷算法、筆試、面經、拿大公司offer神器?? 點擊跳轉進入網站 ?作者簡介:大家好,我是碼莎拉蒂,CSDN博客專家(全站排名Top 50),阿里云博客專家、51CTO博客專家、華為云享專家 1、題目 題目: 實現st…

eclipse啟動tomcat無法訪問

癥狀&#xff1a; tomcat在eclipse里面能正常啟動&#xff0c;而在瀏覽器中訪問http://localhost:8080/不能訪問&#xff0c;且報404錯誤。同時其他項目頁面也不能訪問。 關閉eclipse里面的tomcat&#xff0c;在tomcat安裝目錄下雙擊startup.bat手動啟動tomcat服務器。訪問htt:…

[轉]IntelliJ IDEA 2020.1 正式發布,15 項重大特性、官方支持中文了!

頭圖&作者 | YourBatman&#xff0c;CSDN博客專家 責編 | 唐小引 出品 | CSDN&#xff08;ID&#xff1a;CSDNnews&#xff09; 前言 千呼萬喚始出來&#xff01;自從官方在 2020-01-20 發布了其 2020 年的 Roadmap 后&#xff0c;我便持續關注著、期待著 JetBrains Intell…

【ArcGIS遇上Python】ArcGIS批量為多個矢量圖層添加一個或多個字段(Add Field)案例實現

多個人在利用ArcGIS做數字化之后,需要批量為多個圖層添加一個或者多個相同的字段,挨個手動添加字段顯然不可取。ArcGIS Python提供了快速高效的批量添加字段的解決方案。本文以土地利用數據(Landuse1和Landuse2)為例,采用簡單的Python代碼實現了文中兩個矢量圖層批量添加字…

可下載!Vue3+.NET6實戰系列:通用管理后臺

.NET Framework停更3年&#xff0c;4月份還又停止了3個版本支持&#xff0c;居然還有人沒怎么接觸.NET跨平臺&#xff01;真的該好好學下.NET6了&#xff0c;已經是不得不學了&#xff01;好好看下這套《Vue3.NET6前后端分離電商實戰》免費教程&#xff0c;完整的源碼視頻課件全…

C語言試題192之實現strchr函數功能

??個人主頁:個人主頁 ??系列專欄:C語言試題200例 ??推薦一款刷算法、筆試、面經、拿大公司offer神器?? 點擊跳轉進入網站 ?作者簡介:大家好,我是碼莎拉蒂,CSDN博客專家(全站排名Top 50),阿里云博客專家、51CTO博客專家、華為云享專家 1、題目 題目: 實現st…

簡單團隊-爬取豆瓣電影TOP250-需求分析

1.實現登錄界面 2.搜集相關電影網址 3..按照一定條件爬取電影&#xff0c;實現相關代碼部分 項目步驟&#xff1a; 分析豆瓣電影TOP250的url規則, 編寫模塊獲取相關url分析html中有關"排名,分數,名字,簡介,導演,演員,前10條影評信息,鏈接信息"的標簽編寫將"搜集…

一個想法:成立草根技術聯盟對開發人員進行技術定級解決企業員工招聘難問題!...

背景&#xff1a; 吃飯前&#xff0c;想起了<甄嬛傳>中皇弟嘆息的一句&#xff1a;千軍易得&#xff0c;良將難尋&#xff01; 又逢CTO群里有友人讓我幫忙評估其公司的項目及技術&#xff0c;一番review code&#xff0c;估計要寫那代碼的人要落崗了~ 不由想起&#xff0…