I want to start this article with an unusual, at first glance, digression. Later it will become clear why exactly.
So, let's imagine Someone. This Someone wants to master alpine skiing. And for this he takes the following steps:
- Instructors, textbooks, manuals, etc. - this is all from the evil one. You can learn skiing on your own. In addition, at school he learned to cross-country ski tolerably well. Accordingly, all advice from more knowledgeable people is ignored.
- The coolest equipment is chosen. Not below the expert level. Hard boots that hurt your feet. Hard skis that require a fantastic amount of effort to bend, far exceeding the level of physical fitness of Somebody. Well, etc.
- The test track is... well, let's say, the track hosting the World Cup giant slalom stage. This is just right for studying.
- Continue in the same spirit.
- Literature corresponding to his knowledge level (zero level, frankly speaking) is swept aside. Based on a slight 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, we select... well, let's say chat. A client-server application, the client part in the form of an applet, the server part - a web service or, at worst, servlets. Just right for studying.
- How to convert an array of 8 bytes to long?
- Why does this happen
NoClassDefFoundError
? - Why do I launch the application in Eclipse (
NetBeans/IDEA/JBuilder
), and everything is fine, but without it I typejava HelloWorld.class
, and there is an error? - Why does it crash
ClassNotFoundException
? - Why isn't there a library? I’ve already put it in classes.zip, but it’s all to no avail!
- Why do I create an array of objects, but 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 from the point of view of a virtual machine.
- What is a package?
- What is a library?
- How the virtual machine looks for and loads classes; what is a class loader and how does it work; how many are there by default; what is classpath.
GO TO FULL VERSION