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

Purpose of the Super Keyword - Research Paper Example

Cite this document
Summary
The paper "Purpose of the Super Keyword" describes that the states and aspects of the two classes will differ except for those traits that were inherited. Therefore, inheritance allows an evaluation of the parent’s behavior and state relative to the child’s behavior. …
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER94.3% of users find it useful
Purpose of the Super Keyword
Read Text Preview

Extract of sample "Purpose of the Super Keyword"

? Super Keyword Introduction A keyword in computer programming refers to an identifier or word that has a specified meaning to the programming language. The significance of this word varies depending on the programming language. In most of the languages, keyword refers to reserved words, which classify a syntactic form. In control flow constructs, keywords used include then and else. In other programming languages, keywords cannot be stipulated verbatim they must be stropped. This indicates that keywords must be identified or marked, for instance; by quoting or prefixing using characters. However, other languages have a liberal approach, which allows redefinition of keywords for purposes. Keywords refer to identifiers or symbols which stand for functions or variables. This means that keywords have a characteristic of self evaluating and self quoting interned in the KEYWORD package. They have their application in labeling named opinions to functions, and they represent symbolic values (Savinov, 2008). Programming languages vary on the provision of keywords and library routine. For instance, some languages have provisions for keyword output or input operations, while other languages offer library routine. Languages such as Python and Basic dialect use, print, as a keyword, while Lisp and C use, format and printf, in their standard library. When a programmer applies keywords to functions or variables name, this triggers a compilation error. Most of the current editors have keywords automatically set in different text color for the purposes of indicating that they are keywords. Super keywords have their definition and application in Java, where they play a crucial role during inheritance. Programmers use super keywords when accessing members of the super class. Super keywords have their application when a subclass needs to define or refer to an immediate super class. The super keyword can be invoked when a method overrides one of the super class’s methods. The super keyword in this case can be invoked to override the method. As a result, the super keyword in java indicates the super class of the classes in which the super keyword has recently been used (Leahy, 2011). Super keywords are also standalone statements used in calling the constructor of super classes in the base class. The super keyword has two forms. The first form calls the super class constructor, while the second form accesses members of the super class that have been hidden by members of a subclass. A super keyword can be illustrated as; Public class Super class { Public void printMethod () { System.out.println (“printed in Superclass.”); } } Purpose of the Super Keyword The super keyword can be used when referring to a hidden field. This will enable the access of hidden variable data of the original class. For instance, class A has two instance variables; float b and int a. Class B, expands to class A, and it has its own data members with similar names, (a) and (b). In this instance, class B will be hiding the variables in class A. The super keyword is used in accessing the hidden variables. This can be done by using the super.member; syntax. This gives the super keyword a function of identifying the super class of its identifiable subclass. In this case, members can take the form of an instance variable or a method (Leahy, 2012). The program will display (a) in super class 1 and (a) subclass 2. The instance variable (a) in B conceals the (a) in A, hence; super keyword allows access to (a) defined in the super class. Therefore, the super keyword can be used in calling methods hidden by a subclass. Another purpose of the super keyword is in calling class constructors. Super keywords are used when calling super constructors in a subclass. This is done using the super(parameter-list); syntax. The parameter list includes parameters that the constructor needs in the super class. For instance, the super keyword can be used to cite a super class constructor. The mountain bike can be considered as a subclass of a bicycle. Therefore, the subclass constructor calls the super class constructor and adds an initialization code (Jaswal, 2010). Invocation of the super class should be placed at the first line in the construct; super(parameter list). This allows the super class no-argument constructor to be called because the super class constructor with a similar parameter will be called. In case the constructor does not invoke the super class constructor, the compiler will automatically insert a call for a no-argument constructor of the super class. In case of the absence of the no-argument constructor, a compile time error occurs. Importance of the Super Keyword Super keywords are vital elements in Java programming because they crucially play a role during inheritance. During inheritance, the constructor may want to inherit a method from a class. When inheriting, the method needs to be called first, which can be done by using the super keyword. In the application, the super keyword is useful when creating a component or activity. It lets the constructor/composer call default behavior before implementation. The usefulness of the super keyword can be seen when referring parent classes and in revealing data members hidden by subclasses (Savinov, 2008). If the composition method overrides a super class method, the composer can invoke the overridden methods by using the super keyword. The super keyword can also be used when referring to hidden fields. Additionally, the super keyword can be used in accessing members of an inherited class by the class where it appears. The super keyword allows the constructors to forward a call to a constructor in a super class. How Inheritance Can Be Found In Real-Life Situation Inheritance covers an essential concept in programming. It offers a means for defining relationships in the programming language. In this case, inheritance implies that an object in a program has the capabilities of inheriting a characteristic from another object. This means that an object can pass one of its behaviors, states or characteristics to its objects. Inheritance requires the objects to possess common characteristics for compatibility. An example of real-life inheritance is if we consider a class called human. This class represents physical characteristics in humans. It is a generic class that covers humans in the world. The state of this class keeps track of aspects such as the number of legs, hands and blood types of human beings. It also keeps records of human activities such as eating, walking and sleep. The class offers an opportunity for getting an overall sense of what comprises humanity and similarities in humans (Savinov, 2008). However, it cannot give information concerning such attributes as gender differences. In order for the class to give such information, the composition needs to include two new classes called woman and man. The states and aspects of the two classes will differ except for those traits that were inherited. Therefore, inheritance allows an evaluation of the parent’s behavior and state relative to the child’s behavior. This is because the outcome of the inheritance gives a specialized version of the original object or class. During inheritance, the super class refers to the class from which the traits are being inherited. Reference Jaswal, T. (2010). This and Super Keyword. CSTutoring Center. Page 1-20. Leahy, P. (2012). Super. The New York Times. Page 2-4. Leahy, P. (2011). What Is Inheritance? Java Computing. Page 4-9. Savinov, A. (2008). Concepts and Concept-Oriented Programming. Journal of Object Technology. Vol. 7, (3). Page 1-5. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Super Keyword Research Paper Example | Topics and Well Written Essays - 1000 words”, n.d.)
Super Keyword Research Paper Example | Topics and Well Written Essays - 1000 words. Retrieved from https://studentshare.org/information-technology/1455625-super-keyword
(Super Keyword Research Paper Example | Topics and Well Written Essays - 1000 Words)
Super Keyword Research Paper Example | Topics and Well Written Essays - 1000 Words. https://studentshare.org/information-technology/1455625-super-keyword.
“Super Keyword Research Paper Example | Topics and Well Written Essays - 1000 Words”, n.d. https://studentshare.org/information-technology/1455625-super-keyword.
  • Cited: 0 times

CHECK THESE SAMPLES OF Purpose of the Super Keyword

Bill of Material

The margin for this purpose is estimated at 150 items of personal computers.... Procurement management is an integral part of every project and organization.... The nature of work performed by procurement department is of immense value and the outputs are largely influenced by the recommendations and strategies under stated by this discipline....
5 Pages (1250 words) Essay

Concept of Encapsulation and Data Abstraction

This report "Concept of Encapsulation and Data Abstraction" discusses Object-Oriented approaches that would be the most reliable software application.... Object-Oriented System Engineering would help both companies align their individual information services in a smoother and more efficient manner....
9 Pages (2250 words) Report

How Superbugs Become Super

The paper "How Superbugs Become super" discusses that Rubin criticizes the FDA's lack of support for R&D on antibiotic resistance.... As for the Hudson Institute, McCaughey asks why the Centers for Disease Control and Prevention do not mandate the universal testing of patients for MRSA....
3 Pages (750 words) Research Paper

Program Description: Calculator

The purpose of the ActionListener interface is to receive the Action Events.... By the use of extends keyword, we inherit all the functionality provided in the class Frame, which is used to create a frame using Swings.... Further, we implement the interface ActionListener using the implements keyword.... Moving into the class body, we have declared variables with the final keyword so that their value remains constant throughout the program....
7 Pages (1750 words) Essay

T-Mobile Television Advertising

For instance, a television advertisement broadcast during a live event such as the Olympics or the super Bowl attracts the attention of billions of potential customers.... Television advertising refers to the marketing approach of placing a commercial program on television; organizations produce and pay for advertisements to be broadcast on TV to convey certain messages for the sole purpose of marketing their products or services to prospective consumers....
4 Pages (1000 words) Essay

The main challenges and opportunities with expanding the sonic and compositional potential of the piano

Response to a given question from the seminar Seminar: Tim and Kate: Developing the super-Piano ... They want that the pianist should have access to the extended sounds produced from the super piano without any rearrangement in the keys of the piano (Randles, 2014).... Kim and Kate are engaged in a project to develop a new piano of ‘super' abilities that is, having ability to produce additional sounds.... im and Kate are engaged in a project to develop a new piano of ‘super' abilities that is, having ability to produce additional sounds....
2 Pages (500 words) Essay

Economic Relations between China and the USA

The paper 'Economic Relations between China and the USA' focuses on establishing the economic drivers that have held Washington as the world's dominant power.... As an economist, one should be aware that a huge population plays a significant role in driving the economy of the big cities.... ... ... ...
4 Pages (1000 words) Case Study

Object-Oriented System Engineering

This report "Object-Oriented System Engineering" discusses the transition of the existing information system paradigms of both companies into object-oriented paradigms that would help both companies align their individual information services in a more efficient manner.... ... ... ... The object-Oriented approach might consume little higher time and resource as compared to other solutions, the advantages it can bring in to our business overwhelms these drawbacks and helps us to build a more reliable integrated application that can be easily maintained and can be extended in the future with fewer modifications and complexity....
9 Pages (2250 words) Report
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