Suresh Basandra
![]() |
Software Architecture, Data Structures, Algorithms, Programming and Testing Questions and Answers
—
published
2013
|
|
![]() |
Database, Data Warehouse and Business Intelligence Questions and Answers
—
published
2013
|
|
![]() |
C, C++ and Java Questions and Answers
—
published
2011
|
|
![]() |
Project Management, Program Management, Agile Scrum, Management and Leadership Questions and Answers
3 editions
—
published
2013
—
|
|
![]() |
Management and Leadership Questions and Answers
—
published
2012
|
|
![]() |
Computers Today
—
published
2011
|
|
![]() |
Management Information Systems
2 editions
—
published
2011
—
|
|
![]() |
Database Questions and Answers
—
published
2011
|
|
![]() |
Data Structures and Algorithms Questions and Answers
—
published
2012
|
|
![]() |
Job Interview Questions and Answers
2 editions
—
published
2012
—
|
|
“Object-oriented languages use the paradigm of classes. In simplest terms, a class includes both data and the functions to operate on that data. You can create an instance of a class, also called an object, which will have all the data members and functionality of its class. Because of this, you can think of a class as being like a template, with each object being a specific instance of a particular type of class. For example, suppose you have a very simple class called Person, which has three fields (a data member is called a field in Java) and one method (a function is called a method in Java). The following code illustrates creating a simple class. For example, the first thing inside the beginning brace ({) is a constructor, a special kind of method that creates an instance of a class and sets its fields with their initial values.”
― C, C++ and Java Questions and Answers
― C, C++ and Java Questions and Answers
“Java includes inheritance, or the ability to derive new classes from existing classes. The derived class, also called a subclass, inherits all the data and functions of the existing class, referred to as the parent class. A subclass can add new data members to those inherited from the parent class. As far as methods are concerned, the subclass can reuse the inherited methods as is, change them, and/or add its own new methods. For example, the subclass VerbosePerson could be derived from the class Person, with the difference between instances of the Person class and instances of the VerbosePerson class being the way they identify themselves. The following code creates the subclass VerbosePerson and changes only the implementation of the method identifySelf:”
― C, C++ and Java Questions and Answers
― C, C++ and Java Questions and Answers
Is this you? Let us know. If not, help out and invite Suresh to Goodreads.