Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Zaima Zeniya
45 PointsWhy is Java a static language?
hello, I know this is not related to coding, but i have been searching the answer on internet, and haven't got any understandable answer. I am a beginner. please leave a comment if you know the answer
Thank you.
1 Answer
pradeep k
Courses Plus Student 4,656 PointsThere are a good many reasons why Java is more a static type language
- Earlier detection of programming mistakes, this ensures, that you are writing error free code, lesser run time errors, better type checking. For eg if you are writing a program that calculates the sum of a series of numbers, there is little chance of trying to add a number with a boolean or string, as that would be rejected during compile time itself.
- Better documentation where you could differentiate similiar sounding method names, with number and type of arguments being passed.
- Performance wise this is much more efficient, here the compiler is aware what object a given reference points to, so the calls are more direct, instead of being virtual.
- Better developer experience, using IDEs, as the receiver is aware much before, you have a dynamic drop down menu of all applicable members. For eg, if you are using an Array List, the IDE will identify all possible methods of object, and display it, making the selection more easier.
Zaima Zeniya
45 PointsZaima Zeniya
45 PointsThank you :)