In php/perl we can simply say $a=’hi” and then $a=1 without needing to declare its type. But there are type casting errors in java for the same.
Why this difference?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
PHP is dynamically typed, while Java and C are statically typed.
With static typing, type checking can be done at compile time and this can catch many errors, so it’s not necessarily a bad thing. This also allows them to be much faster than dynamic languages.
See: http://en.wikipedia.org/wiki/Type_system