English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-08-17 06:13:06 · 7 answers · asked by indianYogi 2 in Computers & Internet Programming & Design

For those who'll say , "Classes". For creation of instances for the "Classes" a method has to be there . If what I have is CLasses and more classes then when and how will I create the objects from then ???

2006-08-17 06:28:14 · update #1

7 answers

The method was originally just a function is structural programming. When classes were introduced they started calling functions methods.

2006-08-17 07:59:19 · answer #1 · answered by John J 6 · 0 0

A philosophical question?

This is not analogous to the Chicken & egg or (Egg & chicken) paradox. You can think of the latter problem as one of a temporal compression of two causally linked events. Presumably the origins of both the chicken and egg would have to have been simultaneous. Correspondingly the chicken is the instantiation of an egg -- as an object is that of a class. The method by which this is done may be a concern of biology. Surely, you need a method to instantiate a Class, but both the method and the Class are products of the same, temporally pure, process.
A portion of this is true of the chicken and the egg. You need a method to produce from the latter a version of the former; and you need a version of the former to carry out the method. You need a Class for a constructor method to be called as well.
The problem with this comparison is the desired simultaneity. A programmer can easily write a Class together with methods... While who can determine the relative origins of the chicken and egg?

2006-08-17 06:47:32 · answer #2 · answered by Gilrandir 1 · 0 0

Methods predate OOP. All those GOTO and JAL type commands that no one uses anymore were used to create methods and functions long before classes.

This allowed programmers to place commonly-used blocks of code seperately from the rest of their code. Whenever needed, the program could jump to these commonly-used blocks and execute them as a function or method.

Within OOP itself, methods and classes came at about the same time. Without methods, classes are nothing more than bulky structures; without classes, methods are just lonely functions. To be useful OOP, both are needed.

2006-08-17 06:30:06 · answer #3 · answered by Steve S 4 · 0 0

C++, well back in the days, as i understand, C had no classes but simply functions (methods are functions that dont return nothing). with c++, classes came about in the OOP approach, and they contained various attributes such as functions and variables. So the answer is the method came before the class. But just to let you know, the term method came about recently with the advent of .net.

2006-08-17 06:29:53 · answer #4 · answered by Anonymous · 0 0

obviously classes.

in a true OOP language, all the methods must be inside any class. classes wrap up the variables and methods. outside a class they must not exists. and that is called encapsulation, classes encapsulate variables and methods. and this is a basic concept of OOP.

so, classes come first in OOP.

2006-08-17 06:23:18 · answer #5 · answered by ? 1 · 0 1

If all your techniques are going to be precis, then why don't you in basic terms use an interface? relatively, it relies upon on no remember in case your next training are "is a" (precis type) or "as a" (interface implementation). i do no longer see why an precis type won't be ready to have all precis techniques... yet I do only no longer see the component.

2016-12-11 10:27:28 · answer #6 · answered by ? 4 · 0 0

dont know

2006-08-21 06:17:46 · answer #7 · answered by angeldreams110 2 · 0 0

fedest.com, questions and answers