there are different questions as i am studying programming languages and there are things i want to know

Posted on 2003-03-24
Medium Priority
Last Modified: 2012-05-04
what facilities does cobol have to promote business programming?
why are pointers dangerous?
compare and contrast procedure facility in pascal with object facility in java?
compare and contrast procedure facility in pascal with packages in ada?
why is java safer than c++?
does fortran have dynamic type binding?

this is what i found out

 How is Java unlike C++?
Two classes of language features have been removed from C++ to make it Java. These are those language features which make C++ unsafe and those which make it hard to read.
Features removed that make Java easier to read and understand than C++ include #define, typedef, operator overloading, enum, unions and structs.
The main feature removed to make Java safer and more robust than C++ is pointer arithmetic.
Other features removed include global variables, standalone functions (everything is a method), friend functions (Everything in a package is a friend of everything else in the package.) and non-virtual functions.
A number of features have been added to Java to make it safer including true arrays with bounds checking, garbage collection, concurrency, interfaces (from Objective C) and packages. There is no need to explicitly allocate or free memory in Java.

 Does Java have pointers?
No, no, a thousand times no. Java does not have pointers, no way, no how, the daily email I get from people who think differently not withstanding.
Java does have references. A reference is an abstract identifier for an object. It is not a pointer. A reference tags a particular object with a name in the Java virtual machine so that the programmer may refer to it. How exactly the virtual machine implements references at the level of machine code is VM-dependent and completely hidden from the programmer in any case. Most VMs including Sun's use handles, not pointers. A handle is a pointer to a pointer. At the level of machine code in the CPU a reference is an address in memory where the address of the object is stored. This way the objects can be moved around in memory and only the master pointer needs to be updated rather than all references to the object. This is completely hidden from the Java programmer, though. Only the implementer of the virtual machine needs to worry about it. Indeed, this is not the only way references can be implemented. Microsoft's VM actually does use pointers rather than handles. Other schemes are possible.

Question by:tumie
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 30

Accepted Solution

Mayank S earned 160 total points
ID: 8201320
Cobol mainly has very powerful file-handling techniques and it is veyr easy to access sequential, indexed, random access, etc kinds of files through Cobol and even things like sorting a file based on a key, and modifying an existing record require very little code and effort. That is why, it is very helpful for performing business transactions which involve huge amounts of file-manipulations.

Pointers are dangerous because they directly refer to memory locations. If you're using a simple variable, all refrences made to it in your program will refer to that very variable's memory location. But in case of pointers, you might cause even the entire system to crash if they are unitialized.

Procedure facility in Pascal is a very old method of programming - basically, that is what we used to call as Procedural programming. As far as Ada and Java go, they are object-oriented languages. Meaning that, the emphasis is on "data", not "procedure". Data is given supreme importance and concepts like Data Hiding, Encapsulation, Abstraction, Polymorphism, Inheritance and Reusability come into play. Son, it'll take me a lot more time if I start explaining all those terms.... better read a book on OOPs.

Java might be called safer than C++ because it has strongerexception-handling features than the ones which C++ has. Java also has more object-oriented approach and I would call it more organized - the way its been planned and designed.... like every class which you define will inherit from the Object class.... so on. It is also safer in one respect - it is architecture-neutral and platform-independant. With other programs, you don't know if the program which executed successfully on your machine will execute successfully on other machines or not, and also don't know if the same program wil execute in the same manner on your system tomorrow, in case there are some processor upgrades, OS upgrades, ..... whatever.

Hope all that was of help to you.

LVL 101

Expert Comment

ID: 8207222
SOunds like homework or a test.

Expert Comment

ID: 9446822
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.
LVL 101

Expert Comment

ID: 9447503
Points - mayankeagle

LVL 30

Expert Comment

by:Mayank S
ID: 9451950
Thank you.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Simple Linear Regression

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question