OCJP题库1Z0-851(21/30)

2023-11-10

这套题我参考了这篇文章,以及一些百度上找的内容,再加上自己的解释,总结下来的详解。

第1题:
1.Given a pre-generics implementation of a method:
11. public static int sum(List list) {
12. int sum = 0;
13. for ( Iterator iter = list.iterator(); iter.hasNext(); ) {
14. int i = ((Integer)iter.next()).intValue();
15. sum += i;
16. }
17. return sum;
18. }
What three changes allow the class to be used with generics and avoid an unchecked warning? (Choose
three.)
A. Remove line 14.
B. Replace line 14 with “int i = iter.next();”.
C. Replace line 13 with “for (int i : intList) {”.
D. Replace line 13 with “for (Iterator iter : intList) {”.
E. Replace the method declaration with “sum(List intList)”.
F. Replace the method declaration with “sum(List intList)”.
Answer: A,C,F

解析:
这个题目的意思是,哪三个选项可以一起使用并避免警告;
1.将代码打入会显示不安全警告:List is a raw type. References to generic type List should be parameterized .意思为:List是原始类型。List的范用类型的引用应当被参数化。就是让人搞清楚是那种类型(如,Integer,String)。
List< T >为泛型,对于List中元素不确定时,应用泛型保证其安全性。
泛型要求能包容的是对象型,而基本类型在java中不属于对象。想放int的话应该放Integer,int是基本数据类型,Integer是其包装类。所以应该选F。

泛型详解

2.Integer 会自动拆装箱,所以不需要第14行,所以选A。

Integer自动拆装箱相关内容

  1. for ( Iterator iter = list.iterator(); iter.hasNext(); ) 这个for循环中,
    Iterator iter=buses.iterator()表示获取一个迭代器中当前位置的对象,
    iter.hasNext()判断迭代器中后面是否还有东西,
    留空表示无限制,但是后面代码中并没有让指针移动,例如使用iter.next( ),
    改成for each,选C

for(Iterator iter=cars.iterator();iter.hasNext(); )

第二题:
2.A programmer has an algorithm that requires a java.util.List that provides an efficient
implementation of add(0, object), but does NOT need to support quick random access. What supports these requirements.?
A. java.util.Queue
B. java.util.ArrayList
C. java.util.LinearList
D. java.util.LinkedList
Answer: D
解析:首先,学好英语。。。

A. java.util.Queue

它不在java.util.List下,通常情况下但不一定先进先出,队列还提供额外的插入、提取和检查操作
B. java.util.ArrayList:可调整大小的数组的实现List接口
C. java.util.LinearList:没有在 jdk1.8 帮助文档里找到。。。百度后说是线性表,顺序存储,可实现随机存取

LinearLis

D. java.util.LinkedList:双链表,开头添加数据效率高,通过指针的移动来指向下一个内存地址的分配。

LinkedList

第三题
3.Given:
11. // insert code here
12. private N min, max;
13. public N getMin() { return min; }
14. public N getMax() { return max; }
15. public void add(N added) {
16. if (min == null || added.doubleValue() < min.doubleValue())
17. min = added;
18. if (max == null || added.doubleValue() > max.doubleValue())
19. max = added;
20. }
21.
}
Which two, inserted at line 11, will allow the code to compile? (Choose two.)
A. public class MinMax<?>
{
B. public class MinMax<? extends Number>
{
C. public class MinMax
{
D. public class MinMax
{
E. public class MinMax<? extends Object>
{
F. public class MinMax
{
Answer: D,F
*解析:*必须要有N,而且后面要实现doubleValue()这个方法,object没有这个方法,所以选D,F。

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

第四题
4.Given:
12. import java.util.*;
13. public class Explorer2 {
14. public static void main(String[] args) {
15. TreeSet s = new TreeSet();
16. TreeSet subs = new TreeSet();
17. for(int i = 606; i < 613; i++)
18. if(i%2 == 0) s.add(i);
19. subs = (TreeSet)s.subSet(608, true, 611, true);
20. s.add(629);
21. System.out.println(s + " " + subs);
22. }
23.
}
What is the result?A. Compilation fails.
B. An exception is thrown at runtime.
C. [608, 610, 612, 629] [608, 610]
D. [608, 610, 612, 629] [608, 610, 629]
E. [606, 608, 610, 612, 629] [608, 610]
F. [606, 608, 610, 612, 629] [608, 610, 629]
Answer: E
*解析:*TreeSet是不可重复的且是自然排序的,所以s.add(629)只有一个629,再按顺序就是[606, 608, 610, 612, 629]。
题中的 (TreeSet)s.subSet(608, true, 611, true);相当于取s在[608,611]范围内的值,并且是自然排序的,所以结果为[608, 610]

这里是引用

第五题:
5.Given:

  1. public class Score implements Comparable {
  2. private int wins, losses;
  3. public Score(int w, int l) { wins = w; losses = l; }
  4. public int getWins() { return wins; }
  5. public int getLosses() { return losses; }
  6. public String toString() {
  7. return “<” + wins + “,” + losses + “>”;
  8. }
  9. // insert code here

}
Which method will complete this class?A. public int compareTo(Object o){/more code here/
}
B. public int compareTo(Score other){/more code here/
}
C. public int compare(Score s1,Score s2){/more code here/
}
D. public int compare(Object o1,Object o2){/more code here/
}
Answer: B
解析:
comparable< T >的方法是 compareTo (T o);
而 comparator< T >的方法是compare(T o1, T o2) ;
(查询 jdk 可知)

第六题
6.Given
11. public class Person {
12. private name;
13. public Person(String name) {
14. this.name = name;
15. }
16. public int hashCode() {
17. return 420;
18. }
19.
}
Which statement is true?A. The time to find the value from HashMap with a Person key depends on the
size of the map.
B. Deleting a Person key from a HashMap will delete all map entries for all keys of type Person.
C. Inserting a second Person object into a HashSet will cause the first Person object to be
removed as a duplicate.
D. The time to determine whether a Person object is contained in a HashSet is constant and does NOT
depend on the size of the map.
Answer: A
解析:(参考了文章最开头文章)
A选项:由key来查找value的次数与map的大小有关。map越大,即bucket个数越多,entry链的长度相应的来说就越小;
B选项:删除HashMap中一个Person对象对应的键将会删除这个散列映射表中Person类的全部条目。错误,HashMap中Person对象的键值不是由Person对象决定的,而是程序员给定的键,例如staff.add(“123-345”, bob),就是把键为123-456的bob对象添加到名为staff的HashMap中,因而HashMap允许添加相同的对象。所以说,删除一个键对应的Person对象并不会删除所有的条目,他们的key都不同嘛。

C选项:向HashSet中插入另外一个Person对象将会引起第二个对象覆盖第一个对象。错误,虽然Person对象的hashCode方法返回的值都是420,这仅仅表明两个Person对象在一个entry链表中,接下来要调用equals方法,由于Person类没有equals方法,所以调用Object的equals方法返回对象的存储地址,很明显两个Person对象的存储地址是不同的。综上,HashSet中可以添加不同的Person对象,只要equals方法返回值为false就好。

D选项:判断一个HashSet中是否存在一个Person对象的次数是常数次,和map的大小无关。错误,由于Person对象的hashCode返回的值都是420,所以HashSet中的Person对象都在一个bucket中,组成了一条entry链表,查询速度与entry链表的大小息息相关。

关于Map挺多不理解的,参考他人的解析也不是特别懂,目前先写这样,等详细了解了,再回头更改。

第七题
7.Given:
5. import java.util.*;
6. public class SortOf {
7. public static void main(String[] args) {
8. ArrayList a = new ArrayList();
9. a.add(1); a.add(5); a.add(3);
11. Collections.sort(a);
12. a.add(2);
13. Collections.reverse(a);
14. System.out.println(a);
15. }
16. }
What is the result?A. [1, 2, 3, 5]
B. [2, 1, 3, 5]
C. [2, 5, 3, 1]
D. [5, 3, 2, 1]
E. [1, 3, 5, 2]
F. Compilation fails.
G. An exception is thrown at runtime.
Answer: C
解析:
Collections.sort(a);排序,默认升序; Collections.reverse(a);翻转,所以答案为c

第八题:
8.Given
11. public interface Status {
12. /* insert code here */ int MY_VALUE = 10;
13. } Which three are valid on line
12?
(Choose three.
)A. final
B. static
C. native
D. public
E. private
F. abstract
G. protected
Answer: A,B,D
解析:
在接口中,变量的默认修饰符为public static final;方法的默认修饰符为public abstract;
native修饰符就是java调用非java代码的接口;protected访问修饰符就是访问仅限于包含类或从包含类派生的类型。

第九题:
9.Given:
5. class Atom {
6. Atom() { System.out.print("atom "); }
7. }
8. class Rock extends Atom {
9. Rock(String type) { System.out.print(type); }
10. }
11. public class Mountain extends Rock {
12. Mountain() {
13. super("granite ");
14. new Rock("granite ");
15. }
16. public static void main(String[] a) { new Mountain(); }
17. }
What is the result?
A. Compilation fails.
B. atom granite
C. granite granite
D. atom granite granite
E. An exception is thrown at runtime.
F. atom granite atom granite
Answer: F
解析:
调用子类的构造函数时,也会调用父类的构造函数。如果子类的构造函数没有显示地调用父类的构造函数,则默认调用父类的无参构造函数。

子类实例化时

第十题:
10.Click the Exhibit button. Which three statements are true? (Choose three.)
在这里插入图片描述
A. Compilation fails.
B. The code compiles and the output is 2.
C. If lines 16, 17 and 18 were removed, compilation would fail.
D. If lines 24, 25 and 26 were removed, compilation would fail.
E. If lines 16, 17 and 18 were removed, the code would compile and the output would be 2.
F. If lines 24, 25 and 26 were removed, the code would compile and the output would be 1.
Answer: B,E,F
解析:
这里有两个内部类,一个是名为A的内部类A,一个是名为A的局部内部类A。以我的理解就是,把他们看作全局变量和局部变量。答案就选出来了。

第十一题:
11.Given:
10. class Line {
11. public class Point { public int x,y;}
12. public Point getPoint() { return new Point(); }
13. }
14. class Triangle {
15. public Triangle() {
16. // insert code here
17. }
18.
}
Which code, inserted at line 16, correctly retrieves a local instance of a Point object?
A. Point p = Line.getPoint();
B. Line.Point p = Line.getPoint();
C. Point p = (new Line()).getPoint();
D. Line.Point p = (new Line()).getPoint();
Answer: D
解析:
这里要求写入的代码是构建一个Point的构造函数。因为Point是一个内部类,所以要用Line来调用(用getPoint();方法)。Line.Point p =xxx;其中Line也要进行构造。所以答案为D。
若是要写成Point P=new Point();则需将public class Point改成public static class Point;这是因为Point这个内部类是动态的,而主程序public static class main是静态的,静态方法不能直接调用动态方法,修饰为静态才可以调用。
另外,由于现在的JDK版本较高,所以C选项也不会报错。

第十二题
12.Given:
11. class Alpha {
12. public void foo() { System.out.print("Afoo "); }
13. }
14. public class Beta extends Alpha {
15. public void foo() { System.out.print("Bfoo "); }
16. public static void main(String[] args) {
17. Alpha a = new Beta();
18. Beta b = (Beta)a;
19. a.foo();
20. b.foo();
21. }
22.
}
What is the result?
A. Afoo Afoo
B. Afoo Bfoo
C. Bfoo Afoo
D. Bfoo Bfoo
E. Compilation fails.
F. An exception is thrown at runtime.
Answer: D
解析:
a,b都为Beta类型。

第十三题
13.Click the Exhibit button.
Which statement is true about the classes and interfaces in the exhibit?
在这里插入图片描述
A. Compilation will succeed for all classes and interfaces.
B. Compilation of class C will fail because of an error in line 2.
C. Compilation of class C will fail because of an error in line 6.
D. Compilation of class AImpl will fail because of an error in line 2.
Answer: C
解析:
继承时,重写父类,返回类型要小于等于父类;

所谓子类方法重写父类方法遵循“两同两小一大”的规则
两同:
1)方法名
2)形参列表
两小:
1)返回值类型比父类更小或相等(比较大小时首先要在同一个类型层次中)
2)异常比父类方法更小或相等
一大:
子类权限比父类大或相等

第十四题:
14.Which two code fragments correctly create and initialize a static array of int elements? (Choose two.)
A. static final int[] a = { 100,200 };
B. static final int[] a;
static { a=new int[2]; a[0]=100; a[1]=200;
}
C. static final int[] a = new int[2]{ 100,200 }
;
D. static final int[] a;
static void init() { a = new int[3]; a[0]=100; a[1]=200;
}
Answer: A,B
解析:
A选项和C选项都很好分辨对错;
B选项是静态初始化块,在编译的时候,编译器会自动收集类中的所有静态变量(类变量)和静态语句块(static{}块)中的语句合并产生的,编译器收集的顺序是根据语句在java代码中的顺序决定的。收集完成之后,会编译成java类的 static{} 方法,java虚拟机则会保证一个类的static{} 方法在多线程或者单线程环境中正确的执行,并且只执行一次。

类的加载和初始化

D选项的Init方法不会执行。

第十五题:
15.Given:
10. interface Foo { int bar(); }
11. public class Sprite {
12. public int fubar( Foo foo ) { return foo.bar(); }
13. public void testFoo() {
14. fubar(
15. // insert code here
16. );
17. }
18.
}
Which code, inserted at line 15, allows the class Sprite to compile?A. Foo { public int bar() { return 1;
}
B. new Foo { public int bar() { return 1;
}
C. new Foo() { public int bar() { return 1;
}
D. new class Foo { public int bar() { return 1; }
Answer: C
解析:
类似于第十题;

第十六题:
16.Given:

  1. class Alligator {
  2. public static void main(String[] args) {
  3. int []x[] = {{1,2}, {3,4,5}, {6,7,8,9}};
  4. int [][]y = x;
  5. System.out.println(y[2][1]);
  6. }

}
What is the result?A. 2
B. 3
C. 4
D. 6
E. 7
F. Compilation fails.
Answer: E
解析:
数组从0开始数;

第十七题:
17.Given:
22. StringBuilder sb1 = new StringBuilder(“123”);
23. String s1 = “123”;
24. // insert code here
25. System.out.println(sb1 + " " + s1)
;
Which code fragment, inserted at line 24, outputs “123abc 123abc”
?A. sb1.append(“abc”); s1.append(“abc”)
;
B. sb1.append(“abc”); s1.concat(“abc”)
;
C. sb1.concat(“abc”); s1.append(“abc”)
;
D. sb1.concat(“abc”); s1.concat(“abc”)
;
E. sb1.append(“abc”); s1 = s1.concat(“abc”)
;
F. sb1.concat(“abc”); s1 = s1.concat(“abc”)
;
G. sb1.append(“abc”); s1 = s1 + s1.concat(“abc”)
;
H. sb1.concat(“abc”); s1 = s1 + s1.concat(“abc”)
;
Answer: E

解析:
String类型可以用concat方法,但是String定义的变量不会改变,所以需要再次进行赋值,所以要写s1 = s1.concat(“abc”);而StringBuffer类型的可以直接用append方法;

这里是引用
这里是引用

第十八题:
18.Given that the current directory is empty, and that the user has read and write permissions, and the
following:
11. import java.io.*;
12. public class DOS {
13. public static void main(String[] args) {
14. File dir = new File(“dir”);
15. dir.mkdir();
16. File f1 = new File(dir, “f1.txt”);
17. try {
18. f1.createNewFile();
19. } catch (IOException e) { ; }
20. File newDir = new File(“newDir”);
21. dir.renameTo(newDir);
22. }
23.
}
Which statement is true?
A. Compilation fails.
B. The file system has a new empty directory named dir.
C. The file system has a new empty directory named newDir.
D. The file system has a directory named dir, containing a file f1.txt.
E. The file system has a directory named newDir, containing a file f1.txt.
Answer: E

解析:

这里是引用
这里是引用
这里是引用
这里是引用

第十九题:
19.Given:
11. class Converter {
12. public static void main(String[] args) {
13. Integer i = args[0];
14. int j = 12;
15. System.out.println(“It is " + (ji) + " that ji.”);
16. }
17. }
What is the result when the programmer attempts to compile the code and run it with the
command java Converter 12?
A. It is true that ji.
B. It is false that j
i.
C. An exception is thrown at runtime.
D. Compilation fails because of an error in line 13.
Answer: D

解析:
args是String类型的,所以第13行会报错;
更改后,由于args里没有赋值,会出现越界报错

在这里插入图片描述
越界报错

第二十题
20.Given:
11. String test = “Test A. Test B. Test C.”;
12. // insert code here
13. String[] result = test.split(regex);
Which regular expression, inserted at line 12, correctly splits test into “Test A”, “Test B”, and “Test
C”?
A. String regex = “”;
B. String regex = " ";
C. String regex = “.";
D. String regex = “\s”;
E. String regex = "\.\s
”;
F. String regex = “\w[ .] +”;
Answer: E

解析:
“.”和“”都需要转义字符;
“”有一个和零个,所以要用s*;

不用s*:
在这里插入图片描述
结果:
在这里插入图片描述
不用转义字符:
在这里插入图片描述
结果:
在这里插入图片描述

第二十一题
21.Given:
5. import java.util.Date;
6. import java.text.DateFormat;
21. DateFormat df;
22. Date date = new Date();
23. // insert code here
24. String s = df.format(date);
Which code fragment, inserted at line 23, allows the code to compile?
A. df = new DateFormat();
B. df = Date.getFormat();
C. df = date.getFormat();
D. df = DateFormat.getFormat();
E. df = DateFormat.getInstance();
Answer: E

解析:
DateFormat的作用是格式化Date;帮助我们将Date转换成我们需要的String字符串。这里是对DateFormat初始化。没有D这个方法。

java中Dateformat类的详细使用

第二十二题
22.Given a class Repetition:

  1. package utils;
  2. public class Repetition {
  3. public static String twice(String s) { return s + s; }
  4. } and given another class Demo: 1. // insert code here
  5. public class Demo {
  6. public static void main(String[] args) {
  7. System.out.println(twice(“pizza”));
  8. }
  9. }
    Which code should be inserted at line 1 of Demo.java to compile and run Demo to print
    “pizzapizza”?
    A. import utils.;
    B. static import utils.
    ;
    C. import utils.Repetition.;
    D. static import utils.Repetition.
    ;
    E. import utils.Repetition.twice();
    F. import static utils.Repetition.twice;
    G. static import utils.Repetition.twice;
    Answer: F

解析:
在这里插入图片描述
静态导入:
import static utils.Repetition.twice;//导入Repetition类中的twice静态方法。
import static utils.Repetition.*;//导入Repetition类中的所有静态方法和静态域。

第二十三题:
23.A UNIX user named Bob wants to replace his chess program with a new one, but he is not sure where
the old one is installed. Bob is currently able to run a Java chess program starting from his home directory
/home/bob using the command: java -classpath /test:/home/bob/downloads/.jar
games.Chess Bob’s CLASSPATH is set (at login time) to:
/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/
.jar What is a possible location for the
Chess.class file?
A. /test/Chess.class
B. /home/bob/Chess.class
C. /test/games/Chess.class
D. /usr/lib/games/Chess.class
E. /home/bob/games/Chess.class
F. inside jarfile /opt/java/lib/Games.jar (with a correct manifest)
G. inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)
Answer: C
解析:
不懂暂留;games.Chess Bob’s CLASSPATH is set (at login time) to:
/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jar 这一段是干嘛的,没看懂。

第二十四题:
24.Given:
3. interface Animal { void makeNoise(); }
4. class Horse implements Animal {
5. Long weight = 1200L;
6. public void makeNoise() { System.out.println(“whinny”); }
7. }
8. public class Icelandic extends Horse {
9. public void makeNoise() { System.out.println(“vinny”); }
10. public static void main(String[] args) {
11. Icelandic i1 = new Icelandic();
12. Icelandic i2 = new Icelandic();
13. Icelandic i3 = new Icelandic();
14. i3 = i1; i1 = i2; i2 = null; i3 = i1;
15. }
16.
}
When line 15 is reached, how many objects are eligible for the garbage collector?
A. 0
B. 1
C. 2
D. 3
E. 4
F. 6

Answer: E
解析:
garbage collector:垃圾回收GC

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

OCJP题库1Z0-851(21/30) 的相关文章

随机推荐

  • kafka日志分段(.log文件)及日志文件索引机制(偏移量索引、时间戳索引)

    Kafka版本 2 2 1 环境 CDH 日志分段 segment 格式 在kafka数据存储的目录下 进入topic文件目录 可以看到多个文件 如下 从文件名可以看出 log index timeindex文件一一对应 rw r r 1
  • mysql 死锁_mysql死锁解读

    死锁 Deadlock 什么是死锁 所谓死锁 是指两个或两个以上的进程在执行过程中 因争夺资源而造成的一种互相等待的现象 若无外力作用 它们都将无法推进下去 此时称系统处于死锁状态或系统产生了死锁 这些永远在互相等待的进程称为死锁进程 由于
  • D - Halfway(二分)

    D Halfwayhttps vjudge csgrandeur cn problem Gym 101652Q 暴力 include
  • 常用的/etc/my.cnf配置,可以修改后直接替换

    client port 3378 socket tmp mysql sock default character set utf8 mysql safe updates default character set utf8 prompt u
  • JAVA基础知识点

    一 概述 JAVA语言是美国Sun公司 Stanford University Network 在1995年推出的高级变成语言 2009年Oracle甲骨文公司收购Sun公司 并于2011年发布Java7版本 DOS命令 Win R cmd
  • 2022 年度软件质量保障行业调查报告

    2022 年度软件质量保障行业调查报告 TesterHome https testerhome com topics 35615 覆盖的测试类型 个人提升工作效率的方式 优秀测试人员应该具备的能力 测试同行们的未来计划 阻碍测试进度的因素
  • CMake进阶(一)设置编译选项

    CMake 进阶 一 设置编译选项 CMake设置编译选项 构建Debug版本和Release版本 CMake文件设置 编译过程 CMake设置编译选项 在cmake脚本中 设置编译选项可以通过add compile options命令 也
  • 【超细节】Vue3的属性传递——Props

    目录 前言 一 定义 二 使用 1 在 setup 中 推荐 2 非 setup 中 3 对象写法的校验类型 4 使用ts进行类型约束 5 使用ts时props的默认值 三 注意事项 1 Prop 名字格式 2 对象或数组类型的默认值 3
  • 第十届蓝桥杯 修改数组 (研究生组)

    修改数组 问题描述 给定一个长度为 N 的数组 A A1 A2 AN 数组中有可能有重复出现的整数 现在小明要按以下方法将其修改为没有重复整数的数组 小明会依次修改 A2 A3 AN 当修改 Ai 时 小明会检查 Ai 是否在 A1 Ai
  • hp服务器g5 u盘装系统,hp 440g5怎么装系统

    惠普probook440g5为一款14英寸高性能商务办公本 在升级了英特尔酷睿i7 8代系列处理器后 配合显卡迸发出超凡的性能 很适合外出携带使用 那这款惠普笔记本怎么安装操作系统 今天小编就为大家分享hp 440g5怎么装系统 hp 44
  • PowerMod@快速幂取模

    图片链接 快速幂取模使用心得 看到过于大的数不要害怕 要学会细致分析 想想取模的作用 不就是帮你把大数化小了吗 include
  • 最强自动化测试框架Playwright(25)-浏览器

    Browser Playwright Python 方法 创建page页面 from playwright sync api import sync playwright def run playwright firefox playwri
  • 深度学习正则化

    在设计机器学习算法时不仅要求在训练集上误差 且希望在新样本上 的泛化能 强 许多机器学习算法都采 相关的策略来减 测试误差 这 些策略被统称为正则化 因为神经 络的强 的表示能 经常遇到过拟 合 所以需要使 不同形式的正则化策略 正则化通过
  • JavaWeb-通过表格显示数据库的信息(jsp+mysql)

    login jsp h2 登录 h2 br
  • python+numpy+pandas数据类型+类/对象

    写代码时逻辑明确 但是被各种数据类型以及对象类型搞蒙了 补习并简单记录一下 在进行数据分析之前需要对数据进行数据处理 其中就包含转化数据格式 可以先查看数据信息 再依据分析需求对进行处理 编写python程序时各种数据类型以及对象的类型以及
  • 微信测试账号 (2)-消息验证sha1签名

    在第1篇中实现了收发微信消息 但是没有做验证 本篇将介绍微信如何使用sha签名 对消息进行认证 其中安全相关的概念 如sha1散列值 签名等 可参考web安全 1 验证参数 GetMapping handler public String
  • live555 server 搭建

    一 直接下载live555MediaServer可执行程序 二 Live555在linux平台上编译 下载源码包 http www live555 com liveMedia live555 latest tar gz 1 解压 2 生成M
  • CCPC-南阳比赛总结

    打铁归来 感触好多 记得英语课上 收到晓红老师的消息 说给我们争取下了国赛的名额 我们感觉好幸运 没想到最后打铁了 这个结果也不太意外 下面说下 这几天的行程 反思 下一步的目标 15号 淄博到济南 15 16号 济南 郑州 南阳 17号
  • 如何过滤 map

    获取 EntrySet 然后正常使用 stream 的 filter 过滤 Entry 最后再转为 Map 即可 对 map 过滤 filter Test public void testMapFilter Map
  • OCJP题库1Z0-851(21/30)

    这套题我参考了这篇文章 以及一些百度上找的内容 再加上自己的解释 总结下来的详解 第1题 1 Given a pre generics implementation of a method 11 public static int sum