Ada95 Lovelace Tutorial Section 16.8 (2024)

It makes sense to close a discussion of Ada and Java by comparing the twolanguages.

Ada and Java have more similarities than differences. Both the Ada languageand the Java language were designed with safety in mind(both support strong typing, omit pointers, and perform many compile-timeand run-time checks).Both support an object-oriented approach based on a singleinheritance hierarchy.When generating class files,both Ada and Java support garbage collection, multitasking,and platform-independentgraphical user interfaces (GUIs).

There are differences, of course. Here are some technical advantages ofthe Ada language over the Java language(SigAdahas a similar list):

  1. Ada supports enumerated types.
  2. Ada supports operator overloading for infix operators (for example,you can define an infix + operation for complex numbers).
  3. Ada supports generics. There is no Java equivalent, thoughJava's "Interface" and its root Object class cansometimes be used to do similar things.
  4. Ada supports "in", "out", and "in out" to document the use of parameters,and these modifiers work on both tagged types and scalars.
  5. Ada is easier to read in some cases (compare "and" with "&&";compare "for I in 1..10" with "for (i=1; i <= 10; i++)";compare "a=b" with "a==b").
  6. Ada permits array boundaries to start with any scalar. The Java languagerequires array boundaries to start at 0, a common source of "one-off" errors.
  7. Ada supports numeric range checks more specific than the built-in types.This can be used to detect errors that Java doesn't.
  8. Ada supports method calls using named and unordered parameters,and supports default parameter values.
  9. Ada supports subprogram access types and nested subprograms.

Java has some technical advantages over Ada, too:

  1. Java supports "interface" types.There is no standard Ada equivalent, thoughAda generics and the nesting of objectscan sometimes be used to do similar things.Ada programs that generate Java code can use and define Java interfaces,using a special pragma to do so.
  2. Java permits specifications to be circular (A depends on B which dependson A), while Ada does not. There is some argument that this is a disadvantage,since circular references can indicate poorly structured systems, but interms of ease-of-use this is an advantage.
  3. Java class definitions tend to be shorter than Ada.Here are some of the reasons for this:
    1. Ada enforces a distinction between objects and access valuesto objects.This causes definitions to be longer (for example, in Ada you have to defineX_Obj and X_Ptr types everywhere, while all of that is not usedin the Java language).
    2. Ada requires an explicit list of all classes used ("with" statements) in aclass being defined.Java does not require a list of classes used; the closest Java has isits "import" statement, which is like the "use" clause in Ada.
    3. Java has an implicit "this" parameter for non-static methods; Ada requiresall parameters to be explicitly listed.
    4. Java interfaces have to be handled using a somewhat clumsy Ada syntax.
  4. Java supports hierarchies of exception definitions. Java also includesdefinitionsof exceptions that might be thrown (raised) by each method as part of themethod definition.

Naturally, more than technical issues make a decision. Here are some otherissues regarding the use of the Java language and Ada language for creatingJava applets and applications:

  1. There are a number of tooling issues.At the time of this writingthere are more Ada compilers than Java compilers, but by the time you readthis there should be many compilers for both languages.Most Ada compilersgenerate native (high-speed) code that can take advantage of the underlyinghardware, while Java compilers are just beginning to appear.However, currentlyonly one Ada compiler can generate class files and applets, so the quantityof compilers tilts towards Javaif you're solely interested in generating applets and/or class files.You'll also need to compare the tool capabilities themselves: which havebetter interactive development environments (IDEs)?Which have additional functionality (like user interface generators) thatyou'd like?Since just-in-time Java compilers that take class files can compile both Javaand Ada class files, the choice of language is irrelevantfor just-in-time compilers.
  2. There are large reusable component libraries for both languages, each withdifferent focuses.Compare the relevant reusable componentsin the different languages for your application.
  3. There is an ISO (international) standard for Ada, while a standard for Javais probably many years away (at the time of this writing).
  4. There is a large standard test suite for Ada compilers; none yet existsfor Java.
  5. There are sometimes vendor restrictions prohibiting use of theJava languagefor safety-critical systems; Ada is commonly used in such areas, and compilerscan be bought without such prohibitions.
  6. The use ofJavain real-time applications is somewhat currently a research area,while Ada is already used in such areas and has been for many years.
  7. Most Java materials and tools assume that users are usingthe Java language.Thus, if you're developing a Java application in Ada you'll need tolearn the translation conventions (as discussed in previous sections) andbe able to make such translations mentally.No such translations are needed if you're using the Java language.

Ada95 Lovelace Tutorial Section 16.8 (1)Quiz:

Which of the following statements is true?

  1. The Java language lets you write your own infix operators, whilethe Ada standard supports interface types and hierarchical exceptions.
  2. A web browser that includes a just-in-time compiler for class filescan't compile programs written in Ada.
  3. When generating Java class files, both Ada and Java supportgarbage collection and a standard graphical user interface.
  1. Statement 1.
  2. Statement 2.
  3. Statement 3.
You may also:
Go back to the previous sectionSkip to the next sectionGo up to lesson 16 outline

David A. Wheeler ([email protected])

The master copy of this file is at"http://www.adahome.com/Tutorials/Lovelace/s16sf.htm".

Ada95 Lovelace Tutorial Section 16.8 (2024)
Top Articles
Frequently Asked Questions - Tape & Data Migration Services
How to Remove Duct Tape Residue: 5 Easy Methods – Ram Board
Busted Newspaper Zapata Tx
Gomoviesmalayalam
Craigslist Vermillion South Dakota
Nesb Routing Number
Mr Tire Rockland Maine
Craigslist Dog Sitter
Monticello Culver's Flavor Of The Day
Nestle Paystub
Jack Daniels Pop Tarts
DoorDash, Inc. (DASH) Stock Price, Quote & News - Stock Analysis
Eva Mastromatteo Erie Pa
Driving Directions To Bed Bath & Beyond
Troy Bilt Mower Carburetor Diagram
Conan Exiles: Nahrung und Trinken finden und herstellen
Rugged Gentleman Barber Shop Martinsburg Wv
Morristown Daily Record Obituary
Https Paperlesspay Talx Com Boydgaming
Vegito Clothes Xenoverse 2
yuba-sutter apartments / housing for rent - craigslist
Encyclopaedia Metallum - WikiMili, The Best Wikipedia Reader
The best brunch spots in Berlin
Spiritual Meaning Of Snake Tattoo: Healing And Rebirth!
Restaurants In Shelby Montana
lol Did he score on me ?
Otis Inmate Locator
Missing 2023 Showtimes Near Grand Theatres - Bismarck
Frommer's Belgium, Holland and Luxembourg (Frommer's Complete Guides) - PDF Free Download
The Menu Showtimes Near Amc Classic Pekin 14
Unm Hsc Zoom
Microsoftlicentiespecialist.nl - Microcenter - ICT voor het MKB
Σινεμά - Τι Ταινίες Παίζουν οι Κινηματογράφοι Σήμερα - Πρόγραμμα 2024 | iathens.gr
#scandalous stars | astrognossienne
Pensacola 311 Citizen Support | City of Pensacola, Florida Official Website
School Tool / School Tool Parent Portal
Petsmart Northridge Photos
Housing Intranet Unt
Sdn Fertitta 2024
Deepwoken: How To Unlock All Fighting Styles Guide - Item Level Gaming
Wilson Tire And Auto Service Gambrills Photos
Elven Steel Ore Sun Haven
Holzer Athena Portal
Noga Funeral Home Obituaries
303-615-0055
Kushfly Promo Code
The top 10 takeaways from the Harris-Trump presidential debate
Elvis Costello announces King Of America & Other Realms
Nfl Espn Expert Picks 2023
Public Broadcasting Service Clg Wiki
Cbs Scores Mlb
Latest Posts
Article information

Author: Greg Kuvalis

Last Updated:

Views: 6119

Rating: 4.4 / 5 (75 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Greg Kuvalis

Birthday: 1996-12-20

Address: 53157 Trantow Inlet, Townemouth, FL 92564-0267

Phone: +68218650356656

Job: IT Representative

Hobby: Knitting, Amateur radio, Skiing, Running, Mountain biking, Slacklining, Electronics

Introduction: My name is Greg Kuvalis, I am a witty, spotless, beautiful, charming, delightful, thankful, beautiful person who loves writing and wants to share my knowledge and understanding with you.