TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Date: Wed, 12 Apr 2000 11:54:43 +1000
From: Geoff Bull <[log in to unmask]>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
Organization: Canon Information Systems Research Australia
MIME-Version: 1.0
Parts/Attachments: text/plain (34 lines)
[log in to unmask] wrote:

> Another problem is Java's lack of information hiding (though you *can* get the
> same problem in Ada, it's more difficult)
>
> viz in the code fragment,
>
>    a = 1;
>    b = a;
>    a = a+1;
>
> what does b equal?

1

> In Java:
> if b is the primitive "int", then b=a-1
> if b is the class "Integer" then b = a means in Ada terms b renames a. For which
> we can thank C.

But b must have been a primitive, because operators only work for primitives
(except for "+" for catenating Strings).

Have I missed something?

> If b is a primitive, you can't do text output of it.

int b = 5;
System.out.println ("" + b);
// this prints a line with a 5 on it

Cheers
Geoff

ATOM RSS1 RSS2