Java - Chapter 1 terms- Questions and
Answers| Latest Update
Object-oriented programming (OOP) ✔️✔️OOP is a programming methodology that views a
program as similarly consisting of objects that can act alone or interact with one another. An
object in a program - that is a software object - might represent a real-world object, or it might
be an abstaction.
Attributes ✔️✔️An object has characteristics, or attributes. For example, an automobile object
might have attributes, such as its name, its current speed, and its fuel level.
State ✔️✔️The values of an object's attributes give the object a state.
Behaviors ✔️✔️The actions that an object can take are called behaviors. AS we saw earlier, each
behavior is defied by a piece of Java code called a method.
Class ✔️✔️A class defines s kind of object; it is a blueprint for creating objects.
Encapsulation ✔️✔️Encapsulation sounds as though it means putting things in to a capsule or, to
say it another way, packaging things up. This intuition is basically correct. The most important
part of encapsulation, however, is not simply that things are put into a capsule, but that only
part of what is in the capsule is visible. When you produce a piece of software, you should
describe it in a way that tells other programmers how to use it, but that omits all the details of
how the software program works.
Information hiding ✔️✔️Note that encapsulation hides the fine detail of what is inside the
capsule. For this reason, encapsulation is often called information hiding.
Polymorphism ✔️✔️Polymorphism comes from a Greek word meaning 'many forms.' the basic
idea of polymorphism is that it allows the same program instruction to mean different things in
, different contexts. Polymorphism commonly occurs in English, and its use in a programing
language makes the language more like a human language. For example, the English insturction
"Go play your favorite sport" means different things to different people. In Java, polymorphism
means htat one method name, used as an insturcito, can cause different actions, depending on
the kinds of objects that perform the action. For example, a method named showOutput mgiht
display the data in a nobject. But hte number of data items it displays and their format depend
on the kind of object that carries out hte action.
Inheritance ✔️✔️Inheritance is a way of organizing classes. You can define common attributes
and behaviors once and have them apply to a whole collection of classes. By defining a general
class, you can use inheritance later to define specialized classes that add to or revise the details
of the general class.
Algorithm ✔️✔️An algorithm is a set of instructions for solving a problem, to qualify as an
algorithm, the direcitons must be expressed so completely and so recisely that somebody can
follow them without having to fill in any details or make any decisions that are not fully
specified in the instructions.
Pseudocode ✔️✔️Pseudocode is a combination of English and a programming language
Bug ✔️✔️A mistake in a program is called a bug
Debugging ✔️✔️The process of eliminating mistakes in the program is called debugging
Syntax Error ✔️✔️A syntax error is a grammatical mistake in the program.
Run-time error ✔️✔️An error that is detected when the program is run is called a run-time error
Logic error ✔️✔️if the underlying algorithm for the program ccontains a mistake, or if you write
something in Java that is syntatically correct but logically wrong, but will produce incorrect
output, the program contains a logic error
Answers| Latest Update
Object-oriented programming (OOP) ✔️✔️OOP is a programming methodology that views a
program as similarly consisting of objects that can act alone or interact with one another. An
object in a program - that is a software object - might represent a real-world object, or it might
be an abstaction.
Attributes ✔️✔️An object has characteristics, or attributes. For example, an automobile object
might have attributes, such as its name, its current speed, and its fuel level.
State ✔️✔️The values of an object's attributes give the object a state.
Behaviors ✔️✔️The actions that an object can take are called behaviors. AS we saw earlier, each
behavior is defied by a piece of Java code called a method.
Class ✔️✔️A class defines s kind of object; it is a blueprint for creating objects.
Encapsulation ✔️✔️Encapsulation sounds as though it means putting things in to a capsule or, to
say it another way, packaging things up. This intuition is basically correct. The most important
part of encapsulation, however, is not simply that things are put into a capsule, but that only
part of what is in the capsule is visible. When you produce a piece of software, you should
describe it in a way that tells other programmers how to use it, but that omits all the details of
how the software program works.
Information hiding ✔️✔️Note that encapsulation hides the fine detail of what is inside the
capsule. For this reason, encapsulation is often called information hiding.
Polymorphism ✔️✔️Polymorphism comes from a Greek word meaning 'many forms.' the basic
idea of polymorphism is that it allows the same program instruction to mean different things in
, different contexts. Polymorphism commonly occurs in English, and its use in a programing
language makes the language more like a human language. For example, the English insturction
"Go play your favorite sport" means different things to different people. In Java, polymorphism
means htat one method name, used as an insturcito, can cause different actions, depending on
the kinds of objects that perform the action. For example, a method named showOutput mgiht
display the data in a nobject. But hte number of data items it displays and their format depend
on the kind of object that carries out hte action.
Inheritance ✔️✔️Inheritance is a way of organizing classes. You can define common attributes
and behaviors once and have them apply to a whole collection of classes. By defining a general
class, you can use inheritance later to define specialized classes that add to or revise the details
of the general class.
Algorithm ✔️✔️An algorithm is a set of instructions for solving a problem, to qualify as an
algorithm, the direcitons must be expressed so completely and so recisely that somebody can
follow them without having to fill in any details or make any decisions that are not fully
specified in the instructions.
Pseudocode ✔️✔️Pseudocode is a combination of English and a programming language
Bug ✔️✔️A mistake in a program is called a bug
Debugging ✔️✔️The process of eliminating mistakes in the program is called debugging
Syntax Error ✔️✔️A syntax error is a grammatical mistake in the program.
Run-time error ✔️✔️An error that is detected when the program is run is called a run-time error
Logic error ✔️✔️if the underlying algorithm for the program ccontains a mistake, or if you write
something in Java that is syntatically correct but logically wrong, but will produce incorrect
output, the program contains a logic error