京东2018秋招测试开发工程师笔试题
时长:120分钟 总分:100分
114浏览 0人已完成答题
题型介绍
题型 | 单选题 | 多选题 | 填空题 |
---|---|---|---|
数量 | 16 | 14 | 2 |
SQL查询语句是
下面代码如果用基本路径法测试的话,覆盖几条路径?
void sort(int num, int type){ int a = 0 int b = 0 while(num-- > 0){ if(3==type){ a=b+1 break } else if(4==type){ x=y+10 } else if(5==type){ x=y+20 } else { x=y+30 } } }
现有testfile文件内容如下所示 12 12 213 5434 312...
12
12
213
5434
3123
123
34
对所有数字求和,以下做法正确的是:
定义如下程序: Public class Person{ { ...
public class Person{ { System.out.println("P1") } static{ System.out.println("P2") } public Person(){ System.out.println("P3") } } public class Students extends Person{ static{ System.out.println("S1") } { System.out.println("S2") } public Students(){ System.out.println("S3") } public static void main(String[] args){ new Students() } }程序执行结果是?()
两个子串
括号匹配方案
1. 空串""是合法的括号序列
2. 如果"X"和"Y"是合法的序列,那么"XY"也是一个合法的括号序列
3. 如果"X"是一个合法的序列,那么"(X)"也是一个合法的括号序列
4. 每个合法的括号序列都可以由上面的规则生成
例如"", "()", "()()()", "(()())", "(((())))"都是合法的。 东东现在有一个合法的括号序列s,一次移除操作分为两步:
1. 移除序列s中第一个左括号
2. 移除序列s中任意一个右括号.保证操作之后s还是一个合法的括号序列
东东现在想知道使用上述的移除操作有多少种方案可以把序列s变为空
如果两个方案中有一次移除操作移除的是不同的右括号就认为是不同的方案。
例如: s = "()()()()()",输出1, 因为每次都只能选择被移除的左括号所相邻的右括号.
s = "(((())))",输出24, 第一次有4种情况, 第二次有3种情况, ... ,依次类推, 4 * 3 * 2 * 1 = 24
用浏览器访问<a href="http://www.jd.com" target="_blank">www.jd.com</a>时,可能使用到的协议有?
下面程序的输出是? public class Main {  ...
public class Main { public static void main(String[] args) { Other o = new Other() new Main().addOne(o) System.out.println(o.i) } public void addOne(final Other o) { o.i++ } } class Other { public int i }