Article View: cn.bbs.comp.lang.java
Article #23332Java question 1
From: temporary
Date: Fri, 01 Aug 2003 03:03
Date: Fri, 01 Aug 2003 03:03
24 lines
2014 bytes
2014 bytes
1.Is the following statement true or false?Briefly explain your answer.
A && B is the same as B && A for any Boolean expressions A and B.
2.For each of the following,say if it is true or false.
(1) Array subscripts must be integers.
(2) Arrays cannot contain Strings as elements.
(3) Arrays cannot use Strings as subscripts.
(4) Parallel arrays must have equal length.
(5) Two-dimensional arrays always have the same number of rows and columns
.
(6) Two parallel arrays can be replaced by one two-dimensional array.
(7) Elements of different columns in a two-dimensional array can have
different types.
3.(1) Describe the mechanism of error/exception handling in java.
(2) Why would one use error handling in a constructor? What will happen
with the (partial) object?
(3) (i)Explain the differences between call-by-reference and call-by-value
parameter passing?
(ii) Which systems are used in Java?
4.(1) Write a sample program to explain the use of ConsoleReader class.
(2) Write a simple Bank Account class that rejects negative amounts in the
deposit and withdraw methods and rejects withdrawals that would result in
an overdraft.
--
[m[1;36m�� ��Դ:����ˮ˼Դ bbs.sjtu.edu.cn��[FROM: 202.120.25.44][m
Technical Details
Message-ID:
<47U5ZL$ASL@bbs.sjtu.edu.cn>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsgate.cuhk.edu.hk!news.zixia.net!news.neu.edu.cn!SJTUShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,GB X-Google-Thread: f6cb0,54cfe4f32bf715cd,start X-Google-Attributes: gidf6cb0,public X-Google-ArrivalTime: 2003-07-31 20:04:56 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.media.kyoto-u.ac.jp!newsgate.cuhk.edu.hk!news.zixia.net!news.neu.edu.cn!SJTU From: temporary.bbs@bbs.sjtu.edu.cn (temporary) Newsgroups: cn.bbs.comp.lang.java Subject: Java question 1 Date: 01 Aug 2003 03:03:33 GMT Organization: ��ˮ˼Դ Message-ID: <47U5ZL$ASL@bbs.sjtu.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: Java/M.1059705765.A Lines: 24