Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

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

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.



0
tumie
Asked:
tumie
  • 2
  • 2
1 Solution
 
Mayank SAssociate Director - Product EngineeringCommented:
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.

Mayank.
0
 
mlmccCommented:
SOunds like homework or a test.
0
 
CleanupPingCommented:
tumie:
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 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
mlmccCommented:
Points - mayankeagle

mlmcc
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Thank you.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now