java

位置:IT落伍者 >> java >> 浏览文章

JAVA手机开发高级工程师笔试题 威盛电子(中国)


发布日期:2018年03月18日
 
JAVA手机开发高级工程师笔试题 威盛电子(中国)

选择题
: Consider the class hierarchy shown below:
&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;
class FourWheeler implements DrivingUtilities
class Car extends FourWheeler
class Truck extends FourWheeler
class Bus extends FourWheeler
class Crane extends FourWheeler
&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;&#;
Consider the following code below:
DrivingUtilities du;
FourWheeler fw;
Truck myTruck = new Truck();
du = (DrivingUtilities)myTruck;
fw = new Crane();
fw = du;
Which of the statements below are true?
Choices:
ALine will not compile because an interface cannot refer to an object
BThe code will compile and run
CThe code will not compile without an explicit cast at line because going down the hierarchy without casting is not allowed
DThe code will compile if we put an explicit cast at line but will throw an exception at runtime :Which method you define as the starting point of new thread in a class from which new the thread can be excution?
Apublic void start()
Bpublic void run()
Cpublic void runnable()
Dpublic static void main(String args[]) :Give the following java class: public class Example{
public static void main(String args[]){ static int x[] = new int[];
Systemoutprintln(x[]); }
} Which statement is corrected?
Give the following java class:
public class Example{
public static void main(String args[]){
static int x[] = new int[];
Systemoutprintln(x[]);
}
}
Which statement is corrected?
AWhen compile some error will occur
BWhen run some error will occur
COutput is zero
DOutput is null :Mathround()等于多少?
A
B
C
Dnone :在下述选项时没有构成死循环的程序是
Aint i= while () { i=i%+; if (i>) break; }
Bfor (;;);
Cint k=; do { ++k; }while(k>=);
Dint s=; while (s);&#;s; :Which is the most appropriate code snippet that can be inserted at line in the following code?
(Assume that the code is compiled and run with assertions enabled)
import javautil*;

public class AssertTest
{
private HashMap cctld;

public AssertTest()
{
cctld = new HashMap();
cctldput(&#;in&#; &#;India&#;);
cctldput(&#;uk&#; &#;United Kingdom&#;);
cctldput(&#;au&#; &#;Australia&#;);
// more code&#;
}
// other methods &#;
public String getCountry(String countryCode)
{
// What should be inserted here?
String country = (String)cctldget(countryCode);
return country;
}
}
Which is the most appropriate code snippet that can be inserted at line in the following code?
(Assume that the code is compiled and run with assertions enabled)
import javautil*;

public class AssertTest
{
private HashMap cctld;

public AssertTest()
{
cctld = new HashMap();
cctldput(&#;in&#; &#;India&#;);
cctldput(&#;uk&#; &#;United Kingdom&#;);
cctldput(&#;au&#; &#;Australia&#;);
// more code&#;
}
// other methods &#;
public String getCountry(String countryCode)
{
// What should be inserted here?
String country = (String)cctldget(countryCode);
return country;
}
}Aassert countryCode != null;
Bassert countryCode != null : &#;Country code can not be null&#; ;
Cassert cctld != null : &#;No country code data is available&#;;
Dassert cctld : &#;No country code data is available&#;; :给出下面的代码片断下面的哪些陈述为错误的? ) public void create() {
) Vector myVect; ) myVect = new Vector();
) }
给出下面的代码片断下面的哪些陈述为错误的?
) public void create() {
) Vector myVect;
) myVect = new Vector();
) }A第二行的声明不会为变量myVect分配内存空间
B第二行语句创建一个Vector类对象
C第三行语句创建一个Vector类对象
D第三行语句为一个Vector类对象分配内存空间 :在软件生命周期中下列哪个说法是不准确的?
A软件生命周期分为计划开发和运行三个阶段
B在计划阶段要进行问题焉醛和需求分析
C在开发后期要进行编写代码和软件测试
D在运行阶段主要是进行软件维护 :Given the following class definition: class A{
protected int i; A(int i){
thisi=i; }
} which of the following would be a valid inner class for this class?
Select valid answer:
Given the following class definition:
class A{
protected int i;
A(int i){
thisi=i;
}
}
which of the following would be a valid inner class for this class?
Select valid answer: Aclass B{ }
Bclass B extends A{ }
Cclass B extends A{ B(){Systemoutprintln(i=+i);} }
Dclass B{ class A{} } :What will be printed when you execute the following code?
class X {
Y b = new Y(); X()
{ Systemoutprint(&#;X&#;);
} }
class Y
{ Y()
{ Systemoutprint(&#;Y&#;);
} }
public class Z extends X
{ Y y = new Y();
Z() {
Systemoutprint(&#;Z&#;); }
public static void main(String[] args) {
new Z(); }
}
Choices:
What will be printed when you execute the following code?
class X
{
Y b = new Y();
X()
{
Systemoutprint(&#;X&#;);
}
}
class Y
{
Y()
{
Systemoutprint(&#;Y&#;);
}
}
public class Z extends X
{
Y y = new Y();
Z()
{
Systemoutprint(&#;Z&#;);
}
public static void main(String[] args)
{
new Z();
}
}
Choices:
AZ
BYZ
CXYZ
DYXYZ :Give the following code: public class Example{
public static void main(String args[] ){ int l=;
do{ Systemoutprintln(Doing it for l is:+l);
}while(&#;l>) Systemoutprintln(Finish);
} }
Which well be output:
Give the following code:
public class Example{
public static void main(String args[] ){
int l=;
do{
Systemoutprintln(Doing it for l is:+l);
}while(&#;l>)
Systemoutprintln(Finish);
}
}
Which well be output: ADoing it for l is
BDoing it for l is
CDoing it for l is
DDoing it for l is :Use the operator >> and >>> Which statement is true?
A >> give
B >> give
C >>> give
D >>> give :What will happen when you attempt to compile and run the following code?
int Output = ;
boolean b = false;
if((b == true) &#;&#; ((Output += ) == ))
{
Systemoutprintln(&#;We are equal &#; + Output);
}
else
{
Systemoutprintln(&#;Not equal! &#; + Output);
}
Choices:
What will happen when you attempt to compile and run the following code?
int Output = ;
boolean b = false;
if((b == true) &#;&#; ((Output += ) == ))
{
Systemoutprintln(&#;We are equal &#; + Output);
}
else
{
Systemoutprintln(&#;Not equal! &#; + Output);
}
Choices:ACompilation error attempting to perform binary comparison on logical data type
BCompilation and output of &#;We are equal &#;
CCompilation and output of &#;Not equal! &#;
DCompilation and output of &#;Not equal! &#; :Which statements about Java code security are not true?
AThe bytecode verifier loads all classes needed for the execution of a program
BExecuting code is performed by the runtime interpreter
CAt runtime the bytecodes are loaded checked and run in an interpreter
DThe class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources :下述程序代码中有语法错误的行是( ) int iia[]ib[]; /*第一行*/
for (i=;i<=;i++) /*第行*/ ia[i]=; /*第行*/
ib=ia; /*第行*/
下述程序代码中有语法错误的行是( )
int iia[]ib[]; /*第一行*/
for (i=;i<=;i++) /*第行*/
ia[i]=; /*第行*/
ib=ia; /*第行*/A
B
C
D
简答题
:struts中转换器的实现原理?
:编写子函数()用冒泡法将一个数组排成升序的函数&#;SUB;()在升序数组中插入一个数并且保持该数组仍为升序数组的函数&#;SUB主函数①输入任意个正整数给数组;②调用SUB对数组进行排序;③从键盘输入一个正整数调用SUB将其插入该数组
:输入三个字符串把它们按字典排列依从小到大的顺序输出例如输入aecadcabc 三个字符串它们按字典排列依从小到大的顺序输出为abcadcaec
:spring中定义为Prototype作用域的bean在什么时候会被spring销毁?
:Java中的异常处理机制的简单原理和应用
:如何判别一个数是unsigned
:hibernate中一个操作单元的范围是多大?
:tomcat中什么是DefaultServlet?他的功能是什么?
:应用服务器与WEB SERVER的区别?
:Set里的元素是不能重复的那么用什么方法来区分重复与否呢?
:With tomcatShow me a simple cluster configuration example

               

上一篇:Java基础知识面试题异常相关的选择题

下一篇:Hibernate 有哪5 个核心接口