+ 1
I CANT UNDRESTAND
i cant understand, string, void, class, test, system arg and...
3 Antworten
+ 5
With programming, some languages are quite strict about types. If you think it in real life:
A person is a human, a human a living thing, a living thing can also be type as animal, a plant...
A common point of all these living things is they "eat" something, eat would be a function.
Well then, with my example:
A living thing would be a class
=>A human would be another class that come from a living thing class, we call it Extends
=>An animal would be another class that come from a living thing class, like a human it's based on a living thing.
Inside a living class it has a function call "eat" and so, all class that extends living thing, got the function "eat".
Now if you create a human called "Farzad Garousi" (I randomly pick a name :P), then the human I created will got all functionalities of a human class... AND all functionalities of living thing class.
"Farzard Garousi" would be a human type.
In programing you will have some basic type ever existing, like:
-Integer
-Double
-String
-Object
-...
If I ask to my program to tell me what is the type of "Farzad Garousi" it will probably answer me that the type is "human"
To explain a while some very basic types:
-Integer => Number without decimals
-Double => Number with decimal
-String => Text
I will use a simple Action Script 3 piece of code to try to give an example:
var FarzadGarousi:human = new human();
Means:
variable name:type = new human class();
Then about "void":
If I type the following code:
function eat(){
Bla...bla...bla...
}
If I say that my function "eat" return "void" that means that If ask the result of my function I will have an empty answer, nothing,...
But if I say that my function need to tell me what my human is eating I will not type "void" but maybe "string" and when I will ask "What human is eating?" the function will answer "Chicken legs" :D
+ 2
Thank you geoffrrey, Its very usefull :)) and complete, thanks raman, but I have mathematics skill and I know pascal and Qbasic languages, but java is different I think must test ruby and python.
+ 1
You must understand basic mathematics, and that's all.
Start with simple languages like Ruby or Python