目诊-options是什么意思
1. How many
(a) Exactly one
(b) At most one
(c) None
(d) At least one
Correct answer is
(d)
2. When compiling a Java program that contains syntax errors, the Java compiler will always
(a) ignore the syntax errors and will generate a program that produces approximate results
(b) report syntax errors at the exact locations and will not successfully compile
(c) ignore the syntax errors and will generate a program that produces correct results
(d) report syntax errors at some approximate locations and will not successfully compile
Correct answer is
(d)
3. Upon compilation, the source code of a Java class MyClass will be stored in the file _____, and
the corresponding byte code will be stored in the file _____.
(a) ,
(b) ,
(c) ,
(d) ,
Correct answer is
(b)
4.
When
programming
a
Java
applet,
a
programmer
creates
a(n)
_____
file,
which
a
Java
compiler translates into a(n) _____ file.
(a) source code, bytecode
(b) source code, HTML
(c) bytecode, source code
(d) HTML, bytecode
Correct answer is
(a)
5. Consider the following class.
public class AppletClass extends
{
public void paint(cs g)
ring(
}
}
Before
compiling
this
class,
the
Java
compiler
requires
that
it
be
stored
with
which
of
the
following names?
(a)
(b)
(c) Any filename with the extension
(d)
Correct answer is
(d)
6. Of the following phases of programming, which is generally the phase on which most time is
spent?
(a) Planning a solution to the problem
(b) Testing and evaluation
(c) Coding
(d) Defining the problem
Correct answer is
(b)
7.
Redefining a problem is often done so the programmer can
(a) rewrite the problem using fewer words
(b) reduce syntax errors in the program solution
(c) understand the problem better
(d) write better comments in the program solution
Correct answer is
(c)
8. Programming involves four general phases that the programmer moves into and out of during
the development of a program. The order in which the programmer moves through these phases is
generally which of the following?
(a) planning --> redefining--> coding--> testing
(b) planning --> coding --> testing --> analyzing
(c) defining/redefining --> planning --> implementing/coding --> testing/analyzing
(d) There is no defined order. The programmer
moves into and out of one of the various four
phases as dictated by circumstance and situation while writing the program.
Correct answer is
(d)
9. Which of the following statements is true of the process of programming?
(a) Programming is synonymous with coding.
(b) Most of the time spent in programming is usually spent planning the solution to a problem.
(c) The best way to program is to begin coding immediately, and then to follow up by testing.
(d) Programming can be made easier by dividing a larger problem into smaller pieces.
Correct answer is
(d)
10. Which of the following is a Java statement that imports classes in the package ?
(a) import all
(b) import
(c) import
(d) import .*;
Correct answer is
(d)
11. What is the name of the class whose definition is begun by the following line?
public class Hello extends Greeting
(a) ng
(b) Greeting
(c)
(d) Hello
Correct answer is
(d)
12. The following is a Java program segment:
public void paint (Graphics g)
{
int x = 10;
int y = 20;
paintPicture( g, x, y);
}
public void paintPicture(Graphics g, int a, int b)
{
or();
// more code follows
}
What
will
be
the
value
of
the
parameter
in
the
method
paintPicture
when
this
code
is
executed?
(a) 0
(b)
This
will
not
compile.
This
is
an
error
because
the
parameter
was
never
declared
and
never given a value.
(c) 20
(d) 10
Correct answer is
(d)
13. Valid Java comments include which of the following?
/* this is an /* embedded */ comment */
/* this is an // embedded // comment */
// this is a comment */
(a) II and III only
(b) I and III only
(c) I and II only
(d) I only
Correct answer is
(a)
14.
Which
of
the
following
is
a
term
for
a
set
of
classes
and
methods
that
provide
a
reusable
foundation for a programmer?
(a) Graphical User Interface (GUI)
(b) Java Runtime Environment (JRE)
(c) Application Programming Interface (API)
(d) Java Virtual Machine (JVM)
Correct answer is
(c)
15. A Java servlet can obtain an object for sending data to the client of the servlet by calling which
of the following methods of HttpServletResponse?
(a) getCharacterEncoding
(b) getWriter
(c) encodeURL
(d) setContentType
Correct answer is
(b)
16. Consider a Java source file that begins with the following line.
import .*;
In this file, which of the following lines of code can introduce a valid definition for a Java servlet
class named Welcome?
(a) public class Welcome extends HttpServlet
(b) public servlet Welcome extends HttpServlet
(c) new Welcome extends HttpServlet
(d) servlet class Welcome
Correct answer is
(a)
17. Which of the following is (are) true regarding the Java API documentation?
The list of classes can be filtered by package.
Typically, only the most important methods of a class are listed.
The documentation for one class often refers to other classes.
(a) II and III only
(b) I and II only
(c) I and III only
(d) I, II, and III
Correct answer is
(c)
14.
In a Java servlet, which of the following lines can cause data that was input by a
user into an HTML form to be retrieved?
(a)
n(
(b)
tentType(
(c)
ameter(
(d)
ter();
(c)
Correct answer is
15.
A Java servlet can be declared with the type of content it will produce, such as
image/gif
or
text/html
, by using a call to which of the following methods of
HttpServletResponse
?
(a)
resetBuffer
(b)
addCookie
(c)
encodeURL
(d)
setContentType
(d)
Correct answer is
1. Upon compilation, the source code of a Java class MyClass will be stored in the file _____, and
the corresponding byte code will be stored in the file _____.
(a) ,
(b) ,
(c) ,
(d) ,
Correct answer is
(a)
2. Consider the following class.
public class AppletClass extends {
public void paint(cs g)
ring(
}
}
Before
compiling
this
class,
the
Java
compiler
requires
that
it
be
stored
with
which
of
the
following names?
(a) Any filename with the extension
(b)
(c)
(d)
Correct answer is
(c)
3. When compiling a Java program that contains syntax errors, the Java compiler will always
(a) report syntax errors at the exact locations and will not successfully compile
(b) report syntax errors at some approximate locations and will not successfully compile
(c) ignore the syntax errors and will generate a program that produces approximate results
(d) ignore the syntax errors and will generate a program that produces correct results
Correct answer is
(b)
4. In Java programming, a programmer creates _____ files, and then a compiler translates them
to _____ files.
(a) byte code, source
(b) source, HTML
(c) source, byte code
(d) HTML, byte code
Correct answer is
(c)
5.
When
programming
a
Java
applet,
a
programmer
creates
a(n)
_____
file,
which
a
Java
compiler translates into a(n) _____ file.
(a) HTML, bytecode
(b) source code, HTML
(c) source code, bytecode
(d) bytecode, source code
Correct answer is
(c)
6. Redefining a problem is often done so the programmer can
(a) write better comments in the program solution
(b) understand the problem better
(c) rewrite the problem using fewer words
(d) reduce syntax errors in the program solution
Correct answer is
(b)
7. When a Java class is designed, which of the following is a part (are parts) of the planning stage?
Deciding how to display the results
Writing a problem definition
Identifying the data needed to solve the problem
目诊-options是什么意思
目诊-options是什么意思
目诊-options是什么意思
目诊-options是什么意思
目诊-options是什么意思
目诊-options是什么意思
目诊-options是什么意思
目诊-options是什么意思
本文更新与2021-01-19 16:03,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/533517.html
-
上一篇:考研英语阅读真题解析上
下一篇:中美家庭教育方式比较-文献综述