I want to start this article with an unusual, at first glance, digression. It will become clear later why.
So let's imagine someone. This Someone wants to master skiing. And for this he takes the following steps:
- Instructors, textbooks, manuals, etc. - it's all from the evil one. You can learn skiing on your own. In addition, at school he learned tolerably cross-country skiing. Accordingly, all the advice of more knowledgeable people is ignored.
- The equipment is chosen the coolest. Not below expert level. Hard shoes that hurt your feet. Rigid skis that require fantastic efforts to bend, far exceeding the level of physical fitness of Someone. Well, etc.
- As a test track is chosen ... well, let's say, the track that hosts the World Cup stage in giant slalom. It's just for study.
- Further in the same spirit.
- Literature corresponding to his knowledge of the level (zero level, frankly) is swept aside. Based on a light familiarity with the mentioned C++, C# and OOP theory.
- The most powerful programming environment is taken. Let's say Eclipse or NetBeans. The one that does everything itself, just press one button.
- As a trial application is selected ... well, let's say, a chat. An application of the client-server type, the client part is in the form of an applet, the server part is a web service or, at worst, servlets. For study just right.
- And how to convert an array of 8 bytes to long?
- Why does it happen
NoClassDefFoundError
? - Why do I run the application in Eclipse (
NetBeans/IDEA/JBuilder
) and everything is fine, but without it I typejava HelloWorld.class
, but there is an error? - Why is it flying
ClassNotFoundException
? - Why isn't there a library? I already put it in classes.zip, but it's all to no avail!
- Why am I creating an array of objects, and when I try to use an element of the array, I get
NullPointerException
? - And why ...?
- And why ...?
- And why ...?
- What is a virtual machine and why is it needed.
- What is a class in terms of a virtual machine.
- What is a package.
- What is a library.
- How the virtual machine searches and loads classes; what is a classloader and how does it work; how many by default; what is classpath.