L
L
leha782019-11-12 20:12:03
Java
leha78, 2019-11-12 20:12:03

Why is it necessary to precede the variable with the type of the variable?

Please explain to the php-shnik why when declaring a function, it is necessary to put the name of the class before the variable name? For example Circle var;
And why in a method before parameters it is necessary to interpose type?
public function (String a) {
}
whereas in php you can just
public function (a) {
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2019-11-12
@leha78

Static typing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question