京东2019校招笔试运维工程师笔试题
时长:90分钟 总分:77分
89浏览 0人已完成答题
题型介绍
题型 | 单选题 | 多选题 |
---|---|---|
数量 | 74 | 3 |
下面是一段关于计算变量s的算法: ①变量s的初值是0 ...
已知小顶堆:{51,32,73,23,42,62,99,14,24,394...
TCP协议的拥塞控制就是防止过多的数据注入到网络中,这样可以使网络中的路由...
重复的数据,会增加磁盘空间的占有率,延长操作数据的时间。可以使用规范化处理...
Mysql中表user的建表语句如下,CREATE TABLE&...
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键Id',
`name` varchar(255) DEFAULT NULL COMMENT '名称',
`age` int(11) DEFAULT NULL COMMENT '年龄',
`address` varchar(255) DEFAULT NULL COMMENT '地址',
`created_time` datetime DEFAULT NULL COMMENT '创建时间',
`updated_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
KEY `idx_com1` (`name`,`age`,`address`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表'
以下哪个查询语句没有使用到索引idx_com1?
用户表中有两列name/country。现在要查询用户表中每个国家(cou...
现在要查询用户表中每个国家(country)的用户人数,应使用以下哪个语句
X定义如下,若存在X a a.x=0x1122334...
X a
a.x = 0x11223344 union X{
int x
char y[4]
}
有以下程序#include us...
#include <iostream> using namespace std class D{ int d public: D(int x=1):d(x){} ~D(){ cout<<"D" } } int main(){ D d[]={_____________} D* p=new D[2] delete[]p return 0 }程序运行的结果是DDDDD,请为横线处选择合适的程序( )
有以下程序#include us...
#include <iostream> using namespace std _______________________ void One(float one){cout<<"1"<<endl } void Two(float two){ cout<<"2"<<endl } void Three(float three){ cout<<"3"<<endl } void main(){ float i=1,j=2,k=3 function = One function(i) function= Two function(j) function = Three function(k) }请为横线处选择合适的程序使得程序的运行结果是123 ( )?
有以下程序#include<iostream> us...
#include<iostream>
using namespace std
class complex
{ public:
int real
int imag
complex(int r=0,int i=0)
{ real=r
imag=i}
_________________________________
}
complex add(complex &a,complex & b)
{int r=a.real+b.real
int i=a.imag+b.imag
return complex(r,i)}
int main( )
{complex x(1,2),y(3,4),z
z=add(x,y)
cout<<z.real<<"+"<<z.imag<<"i"<<endl}
程序的输出结果为4+6i,请为横线处选择合适的程序 ( )
有以下程序#include<iostream> #i...
#include<iostream>
#include<fstream>
#include<string>
using namespace std
int main()
{ofstream File1("text.txt")
string d("20160314")
string y=d.substr(0,4)
int k=d.find("2")
int i=d.find("3")
string m=d.substr(k+2,i-k)
string dd=d.substr(i+1,2)
string n=dd+m+y
File1<<n<<endl
File1.close()
}
文件text.txt中写入的结果是( )
有以下函数模版#include <iostream>...
#include <iostream>
using namespace std
template <class T>
void S(T &x, T &y)
{ T temp
temp = x
x = y
y = temp}
template <class T>
void SS(T A[], int n)
{ int min
int i, j
for (i=0 i<n-1 i++)
{ min=i
for (j=_____ j<n j++)
if (A[j]<A[min]) min=j
S(A[i], A[min])
} }
其功能是将A数组中的数按照由小到大的顺序排列,请为横线处选择合适的程序( )
有以下类定义#include u...
#include <iostream> using namespace std class shape { public: virtual int area()=0 } class rectangle:public shape { public: int a, b void setLength (int x, int y) {a=xb=y} int area() {return a*b} }若有语句定义rectangle r r.setLength(3,5) 则编译时无语法错误的语句是( )
下列代码执行后的输出结果为(    ...
int main()
{
char c, s[20]
strcpy(s, "Hello,World")
printf("s[]=%6.9s\n", s)
return 0
}
struct Student{   ...
int num
char name[7]
short age
char sex
}student1
int sz = sizeof(student1)
则执行上面语句后,变量sz的值为( )
对于如下C++程序:int main() { ...
int main() {
vector<int> vInt(1)
cout << vInt[1]
cout << vInt.at(1)
return 0
}
请问两个cout语句分别会发生什么情况()
对于如下C++程序:int main() { ...
int main() {
vector<int> vInt
for (int i=0 i<5 ++i)
{
vInt.push_back(i)
cout << vInt.capacity() << " "
}
vector<int> vTmp(vInt)
cout << vTmp.capacity() << "\n"
return 0
}
请问程序输出的是()
对于如下C++程序:int main() { ...
int a(1), b(3), c(2)
while (a < b < c)
{
++a
--b
--c
}
cout << a << " " << b << " " << c << "\n"
return 0
}
请问输出结果是()
public class Main {&nb...
public static void main(String[] args) {
System.out.println("A")
new Main()
new Main()
}
public Main() {
System.out.println("B")
}
{
System.out.println("C")
}
static {
System.out.println("D")
}
}
以上程序输出的结果,正确的是?
public class Main {&nb...
private static int x = 10
private static Integer y = 10
public static void updateX(int value) {
value = 3 * value
}
public static void updateY(Integer value) {
value = 3 * value
}
public static void main(String[] args) {
updateX(x)
updateY(y)
}
}
执行以上程序后,x和y的值分别是多少?
public class Main {&nb...
public static void main(String[] args) {
String s1 = "abc"
String s2 = "abc"
System.out.println(s1 == s2)
String s3 = new String("abc")
System.out.println(s1 == s3)
}
}
执行以上程序后,输出结果正确的是?
JAVA的类加载期负责整个生命周期内的class的初始化和加载工作,就虚拟...
public class Test {
public static void main(String[] args) {
System.out.println(Test2.a)
}
}
class Test2{
public static final String a="JD"
static {
System.out.print("OK")
}
}
JAVA的类加载期负责整个生命周期内的class的初始化和加载工作,就虚拟...
public class Test {
public static void main(String[] args) {
System.out.println(Test2.a)
}
}
class Test2{
public static final String a=new String("JD")
static {
System.out.print("OK")
}
}
JAVA的类加载期负责整个生命周期内的class的初始化和加载工作,就虚拟...
public class Test {
public static void main(String[] args) {
System.out.println(Test2.a)
}
}
class Test2{
static {
System.out.print("OK")
}
public static final String a=new String("JD")
}
继承是JAVA语言的一个特性,针对类的继承,虚拟机会如何进行父类和子类的初...
public class Test {
public static void main(String[] args) {
System.out.print(B.c)
}
}
class A {
static {
System.out.print("A")
}
}
class B extends A{
static {
System.out.print("B")
}
public final static String c = "C"
}
继承是JAVA语言的一个特性,针对类的继承,虚拟机会如何进行父类和子类的初...
public class Test {
public static void main(String[] args) {
System.out.print(B.c)
}
}
class A {
public static String c = "C"
static {
System.out.print("A")
}
}
class B extends A{
static {
System.out.print("B")
}
}
根据类加载器加载类的初始化原理,推断以下代码的输入结果为?public&n...
public class Test {
public static void main(String[] args) throws Exception{
ClassLoader classLoader=ClassLoader.getSystemClassLoader()
Class clazz=classLoader.loadClass("A")
System.out.print("Test")
clazz.forName("A")
}
}
class A{
static {
System.out.print("A")
}
}
public class Main {&nb...
public static void main(String[] args) {
System.out.print(fun1())
}
public static String fun1() {
try {
System.out.print("A")
return fun2()
} finally {
System.out.print("B")
}
}
public static String fun2() {
System.out.print("C")
return "D"
}
}
执行以上程序后,输出结果正确的是?
import java.util.ArrayListimpor...
import java.util.List
public class Main {
public static void main(String[] args) {
List<String> list = new ArrayList<>()
for(int i=0i<100i++){
list.add("a")
}
}
}
JDK1.8中,执行以上程序后,该list进行了几次扩容?
import java.util.concurrent.Arra...
import java.util.concurrent.ThreadPoolExecutor
import java.util.concurrent.TimeUnit
public class Main {
public static void main(String[] args) {
ThreadPoolExecutor executor = new ThreadPoolExecutor(5, 10, 15, TimeUnit.SECONDS,
new ArrayBlockingQueue<Runnable>(5), new ThreadPoolExecutor.CallerRunsPolicy())
}
}
线程池executor在空闲状态下的线程个数是?
public class Main{ &nb...
public static ArrayList<String> list = new ArrayList<>()
public static void main(String[] args) throws Exception{
Thread t1 = new Main().new MyThread()
Thread E10:E64t2 = new Thread(new Main().new MyRunnable())
t1.setPriority(3)
t2.setPriority(8)
t1.start()
t2.start()
t2.join()
for (int i = 0 i < 100000 i++) {
i++
}
list.add("main")
t1.join()
for (String s : list) {
System.out.println(s)
}
}
class MyThread extends Thread{
@Override
public void run(){
for (int i = 0 i < 100000 i++) {
i++
}
list.add("Thread 1")
}
}
class MyRunnable implements Runnable{
@Override
public void run(){
for (int i = 0 i < 100000 i++) {
Thread.yield()
i++
}
list.add("Thread 2")
}
}
}
下列程序打印结果为(    &nb...
import re
m = re.search('[0-9]','a1b2c3d4')
print(m.group(0))
下列程序打印结果为(    &nb...
import datetime
t1 = datetime.datetime(2017,10,10,21,40)
t2 = datetime.datetime(2017,10,8,23,40)
tt1 = datetime.timedelta(seconds = 1200)
tt2 = datetime.timedelta(weeks = 3)
print(t1 - t2)
将Person表中Name字段为"Lilei"的AGE...
系统管理员编写扫描临时文件的shell程序tmpsc.sh, 测...
文件目录data当前权限为rwx --- ---,只需...
Shell 脚本(shell script),是一种为...
#!/bin/bash
aa='Hello World !'
请问下面选项中哪个能正常显示Hello World !