TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Proportional Font
Show HTML Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Geoff Bull <[log in to unmask]>
Reply To:
Date:
Wed, 12 Apr 2000 11:54:43 +1000
Content-Type:
text/plain
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