StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Differences in Design Objectives - Research Paper Example

Cite this document
Summary
The paper "Differences in Design Objectives" describes that Java and C+ share some common traits but differ at the same time too. Java is a far more secure programming language though slow while C+ is a relatively insecure yet fast programming language. …
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER93.1% of users find it useful
Differences in Design Objectives
Read Text Preview

Extract of sample "Differences in Design Objectives"

? Comparison between C++ and Java Difference in Design Objectives C++ and Java possess differing heritages largely due to different design objectives. C++ is an extension of C and was aimed for systems and application programming. It provided added support for statically typed OOP (Object Oriented Programming), handling exceptions, generic programming and scoped resource management. Moreover, C++ features a standard library that houses algorithms and generic containers. On the other hand Java was created initially as an interpreter for printing systems but it soon encompassed network computing. Later it was adapted as the basis for “HotJava” thin client that depends on a virtual machine that is very portable and secure. Java is provided with a wide-ranging library that supports total abstraction for the fundamental platform. Java is a statically typed OOP like C++ and both languages display a similar syntax though their syntaxes are not compatible with each other. Moreover, Java was designed from scratch and was aimed at portability. (Deitel & Deitel, 2009) Comparison of Features Java and C++ differ significantly when it comes to certain features and implementation in each language. These are discussed below with examples to clarify the differences. Java does not possess multiple inheritances, instead it relies on interfaces. Interfaces in Java are comparable and largely similar to classes in C++ that have nothing except for virtual functions. Java allows inheritance from one base class only even if the other base classes are composed of little else than abstract methods (which are pure virtual functions). However Java allows the implementation of multiple interfaces which is similar to C++ and is nearly similar. (Horstmann & Cornell, 2008) An interface in Java for a Stack would be: public interface Stack { public void Push(Object o); public Object Pop(); }; The structure for C++ is similar and is shown below: class Stack { public: virtual void Push(Object&) = 0; virtual Object& Pop() = 0; }; It must be borne in mind that an interface in Java is not a class and any functions declared in a Java interface are not implementable in the same interface. A Java interface is not allowed any member variables either. This helps Java to eliminate the multiple virtual inheritance problems seen in C++ as it is not possible to inherit identical member variables from more paths than one. Virtual inheritance creates difficulties for the programmers of all kinds. Java solves this by eliminating multiple inheritances of classes by permitting multiple interface implementations. This has simplified Java appreciably in comparison to C++. However there is a drawback too. Java does not allow inheriting implementation from multiple classes in cases where there are no identical member variables too. Most coding situations require that variables have multiple inheritances from base classes that possess data and functions. While C++ can help implement these through careful variable naming, Java disallows it altogether. Another aspect of major difference is garbage collection. Garbage collection is a way to manage memory by freeing memory blocks that are not being referred to anymore. For example if the Java code presented below is considered: Clock a = new Clock(); // a is a new clock // ... a is used for a while a = null; // a is set to null and the system will remove it afterwards The code above creates a new Clock object by using the keyword new. The variable a is used to refer to this new object. a has a similar structure to reference variables used in C++ but Java allows the reassignment of references unlike C++. The variable a is used for some time after which it is reset to null. The Java runtime system keeps a in watch and when it detects that there are no more references to a, it brands a as garbage and clears it up. This aids in returning memory to the heap. In comparison C++ does not offer such an extensive garbage collection system. Although third party freeware and shareware versions for garbage collectors are freely available but they cannot match Java’s precision at eliminating dead memory. (Gupta & Palanki, 2005) Security violations are a direct consequence of allowing programs to use memory management schemes that employ held references and pointers for programs to unused space. If the following code in C++ is considered: void b() { char* c = new char[1000000]; delete [] c; SeachForPasswordsInSeparateThread(c); return; } In this case the last called function i.e. SearchForPasswordsInSeparateThread causes an immediate return but it tends to create a new thread that constantly scans the memory based mega byte that refers to c. The megabyte in question has been returned to the memory heap but other programs and functions could easily access it. If such a structure were used to house sensitive information such as passwords, credit card CVV2 codes or the like then any functions with a dead pointer held into the heap could well easily examine the data. This is clear proof that manual memory management systems are not reliable such as those implemented with C++ frameworks. Java is used extensively to create applets for use with web pages. Most applets are downloaded to the client machine before being executed in web browsers. Manual memory management would allow the use of insecure applets to download malicious code and software into client machines. However, with its memory management techniques, Java does not allow this to occur unlike C++. On the other hand while this feature offers Java security, it also causes Java to slow down as the garbage collector runs because it can consume large amounts of processing power. (Lewis & Neumann, 2004) Another area of interest is the presence of goto statement in C++ while Java possesses labelled break and continue. Structured programming does not discourage the use of the goto statement; it only discourages its use in situations that compromise the single entry / single exit flow methodology. It is allowed to use goto to accomplish tasks similar to for and while loops while structured programming criteria are not violated. However there is little need to do so in both Java and C++ as such statements already exist. The utilisation of break and continue can be seen as a violation of the single entry / single exit paradigm. While using break and continue are serious violations, the use of labelled break and continue can be seen as far more serious violations. Using these statements to exit nested blocks and especially deeply nested blocks can produce errors that are extremely hard to identify. This is all the more true if the enclosing blocks is not aware of the exodus and if the enclosing blocks are not coded to handle the exodus. (Flanagan, 2005) If the following code in C++ is considered: outermost: for (int i=0; i Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Comparison between C and Java Research Paper Example | Topics and Well Written Essays - 1000 words”, n.d.)
Retrieved from https://studentshare.org/information-technology/1430915-c-vs-java
(Comparison Between C and Java Research Paper Example | Topics and Well Written Essays - 1000 Words)
https://studentshare.org/information-technology/1430915-c-vs-java.
“Comparison Between C and Java Research Paper Example | Topics and Well Written Essays - 1000 Words”, n.d. https://studentshare.org/information-technology/1430915-c-vs-java.
  • Cited: 0 times

CHECK THESE SAMPLES OF Differences in Design Objectives

Evaluation of Play in Design for Behavioral Change

The paper "Evaluation of Play in design for Behavioral Change" discusses that implementation of a valid research play and design begins from the introduction of the kind of research where the play designer comes up with a proposal on which kind of play to carry out kind of research on.... Through gained knowledge on the research nature, it would be easier for the researcher to come up with aims and objectives that are supposed to be taken into account when designing a game....
12 Pages (3000 words) Essay

Dual Protection in Design and Copyright

This essay "Dual Protection in design and Copyright" focuses on each intellectual property.... Though both are intellectual property and both aim to protect the rights of the IP holder, the objectives and techniques of protection of each would differ.... The copyright protection would be aimed at protecting the artistic portion of the industrial design, whereas the industrial design would be aiming to protect the non-functional aspects....
8 Pages (2000 words) Essay

Two Management Systems and Differences with Respect to Three Management Areas

Some of the ways include the use of favorable management systems, and adopting policies that will guide the organization to attain the organization's objectives.... Designing team-based organizations address issues concerning the implementation of teams, and the focus is on the design that is required to support the attaining of the organization's objectives (Stewart et al,2001 p320).... This paper "Two Management Systems and differences with Respect to Three Management Areas" accents each company chooses conditions that will ensure the realization of its mission....
8 Pages (2000 words) Essay

Learning Diversity and Authentic Assessment Tools

PERFORMANCE OBJECTIVE: At the end of this unit the student should be able have strong abilities of solving problems that relate to electric potential, fields and potential differences.... Focusing event: how to demonstrate the major differences between the cell types g....
4 Pages (1000 words) Essay

Product and Service Design

Firms are acknowledging the model behind manufacturing can be translated beyond cost control to design products and services that are easily maintained and serviced.... Improving the manufacturing process is an important goal in product and service design (WSP, 2013).... Products or service design should be closely linked with an organization's strategy.... It can be noted that a major cause of operations failed can be attributed to faulty design....
12 Pages (3000 words) Research Paper

What is the difference between Art & Design

One just needs to attain the objectives of the design he/she is out to create.... The issue of what separates design from art has been a topic that confuses many people till today.... In the world, today, there are plenty of differences that exist between designers and artists (Fichner-Rathus Art & design Designers and artists alike create visual representations using similar knowledge bases.... The issue of what separates design from art has been a topic that confuses many people till today....
2 Pages (500 words) Essay

Design and Development of Superior Heat Exchangers

The project is executed for the achievement of the aims and objectives as are associated with the execution of the project on a successful basis.... These aims and objectives are as under: ... All the team members are working in a coordinated and systematic pattern so as to achieve the objectives of the project within the given time period.... This paper "design and Development of Superior Heat Exchangers" tells that the designing of superheat exchangers is an activity with an objective to manufacture the devices for the transfer of heat from the systems to the surroundings in a mechanism regulated by the fundamental laws of heat....
23 Pages (5750 words) Research Paper

Tactics for Achieving Fire Safety Success

n approximately 250 words explain what is meant by, and the differences between, prescriptive and performance-based design.... n fire safety standards, there are codes and design specifications that must be met when constructing different types of buildings.... Prescriptive design is where specific requirements, span tables, pre-fined design options and rules are applied to develop a design that complies with the codes of required standards (Woodworks, 2014)....
8 Pages (2000 words) Assignment
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us