一些JAVA问题,初学者需要讲解?
1.Programminginvolvesfourgeneralphasesthattheprogrammermovesintoandoutofduringthedeve...
1.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) 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.
(b) planning --> redefining--> coding--> testing
(c) defining/redefining --> planning --> implementing/coding --> testing/analyzing
(d) planning --> coding --> testing --> analyzing
(编程的一般步骤是怎么样的?)
2.Valid Java comments include which of the following?
I. /* this is an /* embedded */ comment */
II. /* this is an // embedded // comment */
III. // this is a comment */
(a) I only
(b) I and II only
(c) I and III only
(d) II and III only
(注释的规则有哪些?)
3.Consider a Java servlet that is invoked upon the submission of a form. If the form contains a radio button control with the name Foo, which of the following lines of code in the servlet can retrieve the value of this radio button?
(a) request.getRadio("Foo");
(b) request.getFoo();
(c) request.getParameter("Foo", radio);
(d) request.getParameter("Foo");
4.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) response.setContentType("text/html");
(b) response.getWriter();
(c) out.println("Form value");
(d) request.getParameter("Name");
3和4在调用方法是有什么异同?
5.Consider the following Java code fragment.
public class TrafficLight{
int status;
public void changeStatus(int newStatus) {
status = newStatus;
}
public void turnOn(int newStatus) {
// . . .
}
}
In the method turnOn, which of the following statements should be used to call method changeStatus?
(a) changeStatus.newStatus;
(b) changeStatus(newStatus);
(c) TrafficLight.changeStatus(newStatus);
(d) changeStatus(TrafficLight, newStatus);
注:5中先TrafficLight的类,然后定义了叫changeStatus和turnOn的方法,那么要调用changeStatus的方法应该是C啊,为什么是B直接调用。比如6题调用方法时就是br.readLine();
6.If variable br references an instance of the class java.io.BufferedReader, which of the following statements is a legal call to the method readLine of the class?
(a) br.readLine;
(b) br(readLine);
(c) readLine(br);
(d) br.readLine();
我们的教材都是英文的啊,我也看得头大啊。
回复三楼:不是NIIT,我是大一的,我们的教材是英文的,作业也是英文的。 展开
(a) 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.
(b) planning --> redefining--> coding--> testing
(c) defining/redefining --> planning --> implementing/coding --> testing/analyzing
(d) planning --> coding --> testing --> analyzing
(编程的一般步骤是怎么样的?)
2.Valid Java comments include which of the following?
I. /* this is an /* embedded */ comment */
II. /* this is an // embedded // comment */
III. // this is a comment */
(a) I only
(b) I and II only
(c) I and III only
(d) II and III only
(注释的规则有哪些?)
3.Consider a Java servlet that is invoked upon the submission of a form. If the form contains a radio button control with the name Foo, which of the following lines of code in the servlet can retrieve the value of this radio button?
(a) request.getRadio("Foo");
(b) request.getFoo();
(c) request.getParameter("Foo", radio);
(d) request.getParameter("Foo");
4.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) response.setContentType("text/html");
(b) response.getWriter();
(c) out.println("Form value");
(d) request.getParameter("Name");
3和4在调用方法是有什么异同?
5.Consider the following Java code fragment.
public class TrafficLight{
int status;
public void changeStatus(int newStatus) {
status = newStatus;
}
public void turnOn(int newStatus) {
// . . .
}
}
In the method turnOn, which of the following statements should be used to call method changeStatus?
(a) changeStatus.newStatus;
(b) changeStatus(newStatus);
(c) TrafficLight.changeStatus(newStatus);
(d) changeStatus(TrafficLight, newStatus);
注:5中先TrafficLight的类,然后定义了叫changeStatus和turnOn的方法,那么要调用changeStatus的方法应该是C啊,为什么是B直接调用。比如6题调用方法时就是br.readLine();
6.If variable br references an instance of the class java.io.BufferedReader, which of the following statements is a legal call to the method readLine of the class?
(a) br.readLine;
(b) br(readLine);
(c) readLine(br);
(d) br.readLine();
我们的教材都是英文的啊,我也看得头大啊。
回复三楼:不是NIIT,我是大一的,我们的教材是英文的,作业也是英文的。 展开
4个回答
展开全部
蛋疼!做题毫无作用,只是把脑袋搞僵而已,学一些好点的教材(中文的就可以),然后自己考虑开发个小程序之类的,比做这些无聊的题好处多了去了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
NIIT?
1.C
2.D (copy the comments to eclipse and then you will find the answer.)
3.D
4.D
5.B The right answer is this---this.changeStatus(newStatus);
6.D
Just FYI, and also i'm not sure the correctness.
And English is also very important.
1.C
2.D (copy the comments to eclipse and then you will find the answer.)
3.D
4.D
5.B The right answer is this---this.changeStatus(newStatus);
6.D
Just FYI, and also i'm not sure the correctness.
And English is also very important.
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
做这些题有什么用?
把基础打好,还是看中文的吧 ,英文看着脑袋疼
把基础打好,还是看中文的吧 ,英文看着脑袋疼
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询