Computer Science, asked by reeuc2203, 7 months ago

an action that and object is capable of performing is called​

Answers

Answered by manjumodukuru
3

Answer:

well as with its type system. Indeed, this last point is unique to the language. Thus we have an object-oriented, statically typed language, with type inference. This extension allows definition of classes and instances, class inheritance (including multiple inheritance), parameterized classes, and abstract classes. Class interfaces are generated from their definition, but may be made more precise through a signature, similarly to what is done for modules.

Object-Oriented Terminology

We summarize below the main object-oriented programming terms.

class:

a class describes the contents of the objects that belong to it: it describes an aggregate of data fields (called instance variables), and defines the operations (called methods).

object:

an object is an element (or instance) of a class; objects have the behaviors of their class. The object is the actual component of programs, while the class specifies how instances are created and how they behave.

method:

a method is an action which an object is able to perform.

sending a message

sending a message to an object means asking the object to execute or invoke one of its methods.

Class Declaration

The simplest syntax for defining a class is as follows. We shall develop this definition throughout this chapter.

Syntax

class name p1 ...pn =

object

:

instance variables

:

methods

:

end

p1, ..., pn are the parameters for the constructor of the class; they are omitted if the class has no parameters.

An instance variable is declared as follows:

Syntax

val name = expr

or

val mutable name = expr

When a data field is declared mutable, its value may be modified. Otherwise, the value is always the one that was computed when expr was evaluated during object creation.

Methods are declared as follows:

Syntax

method name p1 ...pn = expr

Other clauses than val and method can be used in a class declaration: we shall introduce them as needed.

Our first class example.

We start with the unavoidable class point:

the data fields x and y contain the coordinates of the point,

two methods provide access to the data fields (get_x and get_y),

two displacement methods (moveto: absolute displacement) and (rmoveto: relative displacement),

one method presents the data as a string (to_string),

one method computes the distance to the point from the origin (distance).

Answered by abdulraziq1534
1

Concept Introduction:-

A machine that is electronic in nature which can store, find and arrange information and also can perform calculations and operate other equipment.

Explanation:-

A question has been provided to us

We need to find the solution to the question

An action that and object is capable of performing is called​ Method. An object's behaviors include methods and events. Methods are the operations (actions) that the object is capable of performing. For example, a button can use its Focus method to send the focus to itself.

Final Answer:-

The correct answer is an action that and object is capable of performing is called​ Method.

#SPJ2

Similar questions