2018.6.22 Java question test results

Source: Internet
Author: User
Tags mysql index

How to crawl a webpage from a digitally-numbered URL and save it in the current directory? Suppose the URL is http://test/0.xml, where the number can be incremented to 100.
for((i=0;i<100;++i));do  wget http://test/$i.xml; done
On the computer network, the following statement is correct 1 2 5
(1)在向下的过程中,需要添加下层协议所需要的首部或者尾部(2)在向上的过程中不断拆开首部和尾部(3)在向上的过程中,需要添加下层协议所需要的首部或者尾部(4)在向下的过程中不断拆开首部和尾部(5)SMTP属于TCP协议(6)POP3属于UDP协议(7)DNS属于TCP协议(8)Telnet属于UDP协议
On the MySQL index, the following is correct (B) 2 4
(1)B+Tree 索引是大多数 MySQL 存储引擎的默认索引类型(2)在 MySQL 中只有 Memory 引擎显式支持哈希索引(3)哈希索引只包含哈希值和列指针,而不存储字段值(4)MyISAM 存储引擎支持空间索引,可以用于地理数据存储。(5)空间索引使用 MATCH AGAINST,而不是普通的 WHERE(6) 索引将顺序 I/O变为随机 I/O

Explain

(1) BTree 索引是大多数 MySQL 存储引擎的默认索引类型,不是B+Tree。(2) 哈希索引是memory引擎表的默认索引类型,memory也支持btree。(3) 哈希索引只包含哈希值和行指针,而不存储字段值,所以不能使用索引中的值来避免读取行(即不能使用哈希索引来做覆盖索引扫描)。(5) 空间索引不会要求where子句使用索引最左前缀可以全方位索引数据,可以高效使用任何数据组合查找 配合使用mercontains()函数使用。(6) 索引将随机I/O变为顺序I/O
In a Linux system, what can be used to find the executable file?
(1)whereis(2)locate(3)which(4)type(5)findA (1)(2)(3)B (1)(2)(5)C (1)(2)(3)(5)D (1)(2)(3)(4)(5)
There is a TCP connection, its maximum message segment length is 4kb,tcp congestion window is 24KB, when a timeout occurs, then the Congestion window becomes (4KB)
TCP报文中,当发生超时事件,阈值被设置成当前拥塞窗口的一半,而拥塞窗口被设为一个最大报文段,也就是4KB。
In Java, class Testutil is defined in package COM, and class testutil is defined in the COM's child package util, given the following Java code, which occurs when the compilation is run (the compilation fails).
package test;import com.util.TestUtil;import com.TestUtil;public class Test {  public static void main(String[] args)  {    TestUtil testutil = new TestUtil();  }}
Given the Java code as shown below, the output is (2 2 2) after the compilation is run.
public class Test {    static int a;    int b;    static int c;     public int aMethod() {        a++;        return a;    }     public int bMethod() {        b++;        return b;    }     public static int cMethod() {        c++;        return c;    }     public static void main(String args[]) {        Test test1 = new Test();        test1.aMethod();        System.out.println(test1.aMethod());        Test test2 = new Test();        test2.bMethod();        System.out.println(test2.bMethod());        Test test3 = new Test();        test3.cMethod();        System.out.println(test3.cMethod());    }}注释    关于类的成员变量若没有赋值,都存在默认值的,    对于基本类型,都存在对应值,int : 0    对于引用类型,为null
Given a Java program, the main method is as follows, after the program compiled and run the result is (runtime exception).
public class A{public static void main(String[] args) {    String str="ww";    str.concat("abc");    str.concat("123");    System.out.println(str);    }}注释    1.字符串连接的时候链接一个新的字符串对象来保存新的连接成的字符串    2.或者写成不用在原字符串是你的改变,在连接时用字符串原始值
Given a Java program, the main method is as follows, after the program compiled and run the result is (22 22).
public class Test {    int count = 21;    public void count() {        System.out.println(++count);    }    public static void main(String args[]) {        new Test().count();        new Test().count();    }}注释     ++C是先将变量C进行加一操作,是“先赋值,后使用”,所以调用方法输出的结果是22。而main()方法中new出来的是两块空间,所以结果都是22。
In JDK1.8, HashMap does not implement which interface (ABSTRACTMAP).
AbstractXX的多半是抽象类,而不是接口,接口不需要强调抽象,他不可能不抽象
The following about the process and threading is wrong (B)
A进程是系统进行资源分配和调度的基本单位,而线程是CPU调度和分配的基本单位B线程也拥有自己的系统资源C一个线程可以创建和撤销另一个线程D一个进程中的多个线程共享资源线程自己拥有:状态和计数器同一个进程内的线程共享这个进程的资源所有线程是没有自己的系统资源的,多个线程是交替使用其进程的资源线程是指进程内的一个执行单元,也是进程内的可调度实体.与进程的区别:(1)地址空间:进程内的一个执行单元;进程至少有一个线程;它们共享进程的地址空间;而进程有自己独立的地址空间;(2)资源拥有:进程是资源分配和拥有的单位,同一个进程内的线程共享进程的资源(3)线程是处理器调度的基本单位,但进程不是.4)二者均可并发执行.进程和线程都是由操作系统所体会的程序运行的基本单元,系统利用该基本单元实现系统对应用的并发性
The following about thread synchronization is wrong to say (D)
A用户模式和内核模式下同步方式不同B对于临界区的访问适用于单进程中线程间的同步C事件对象适用于多个进程间的各线程实现同步D互斥对象也只适用于单进程中线程间的同步解释:他是内核对象,不同进程的多个线程可以访问单个互斥对象,这样可以确保多个线程同时访问内存块,内存块中数据不会遭到破坏。
The following statement about deadlocks is wrong (D)
A死锁是指多个进程因抢占资源而发生的一种阻塞且相互等待的现象B死锁的产生源于系统资源不足和进程推进顺序不当C可以通过终止和撤销进程来解除死锁D银行家算法用在预防死锁策略中银行家算法(Banker‘s Algorithm)是一个避免死锁(Deadlock)的著名算法  银行借贷系统的分配策略为基础,判断并保证系统的安全运行。产生死锁的四个条件:(1) 互斥条件:一个资源每次只能被一个进程使用。(2) 请求与保持条件:一个进程因请求资源而阻塞时,对已获得的资源保持不放。(3) 不剥夺条件:进程已获得的资源,在末使用完之前,不能强行剥夺。(4) 循环等待条件:若干进程之间形成一种头尾相接的循环等待资源关系。
with 1 3 Tile-Shop 3How many ways are there in the 20 floor?
3*n的区域铺瓷砖为f(n),如果第一列竖着,那么就是f(n-1),如果横着铺,就是f(n-3)。f(n) = f(n-1) + f(n-3),递推结果为1278。动态规划,转移方程为:f[i] = 2*f[i-3] + f[i-4] + f[i-5];代码实现public class Main {    public static void main(String[] args) {        int[] a = new int[20 + 5];        a[0] = 1;        a[1] = 1;        a[2] = 1;        a[3] = 2;        a[4] = 3;        for (int i = 5; i <= 20; i++) {            a[i] = (a[i-3] << 1) + a[i-4] + a[i-5];            System.out.println(i + "  " + a[i]);        }    }}
4 matrices are known to have a size of M1 (5 3) M2 (34) M3 (4 2) M4 (27) The optimal number of multiplication times required for the following combinatorial calculations? (((m1m2) M3) M4)

2018.6.22 Java question test results

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.