From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aef01dc1d0a3a8bd X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Dummy Date: 2000/02/03 Message-ID: <3899DB45.B481F8E2@averstar.com>#1/1 X-Deja-AN: 581213238 Content-Transfer-Encoding: 7bit References: <387b154a.3533365@newsread.albacom.net> <3898C380.BC01EC03@earthlink.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@inmet2.burl.averstar.com X-Trace: inmet2.burl.averstar.com 949607238 14993 141.199.8.164 (3 Feb 2000 19:47:18 GMT) Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 NNTP-Posting-Date: 3 Feb 2000 19:47:18 GMT Newsgroups: comp.lang.ada Date: 2000-02-03T19:47:18+00:00 List-Id: Hyman Rosen wrote: > > Charles Hixson writes: > > Java is more Object Oriented than Ada is, but less type safe. > > (Those casts are a really bad idea that is carried forwards from C.) > > Java casts are always perfectly safe. Casts between object types are > akin to C++'s dynamic_cast, in that they are type-checked at runtime > and will fail if the cast is not valid. Java and Ada are approximately equal in "safety" when it comes to "object-oriented" types. (Ada allows the distinction between "specific" and "class-wide" which Java does not support, and the corresponding option of static versus dynamic binding of calls on primitive operations. This might be considered more "type safe" in some people's view. Finally, Ada has local/stack-resident composite objects; all composite objects in Java are allocated out of the heap -- there is no compile-time way to ensure their lifetime is limited to a single function invocation.) Ada has much more type safety than Java when looking at numeric or enumeration types. Ada's arrays are also more strongly typed, because only the declared index type may be used for indexing, whereas in Java, any integral type may index any array. Ada also allows compile-time distinctions between access (reference) types, each with potentially its own heap. In Java, all objects are dynamically allocated out of a single garbage-collected heap. -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA