Notes on Apache Ant
A basic checklist before diving into Ant 1. Make sure that files inside /AntInstallDirectory/bin are on the PATH environment variable 2. Make sure that files inside /AntInstallDirectory/lib are part of the CLASSPATH environment variable. If you need instruction on how to set environment variables in Windows, go to this page, if you need instruction on [...]
Hello World java
To make sure that you have installed your development environment properly, break it in using the Hello World program. Launch your editor–notepad will do, gedit, TextEdit, TextMate etc. I wouldn’t advise using word processors like MS Word or OpenOffice, it might generate some other characters that will interfere with the compilation process. Here’s a simple [...]
Increment and decrement operator
Java has increment and decrement operator pretty much like C, C++ and C# and other languages. They do behave predictably the same too. You can copy the code above and save it to a file named IncDec.java, then compile and run it as $ javac IncDec.java $ java IncDec Just note the behavior of postfix [...]
How to tell an object’s class type
If you need to know exactly what the object type of a class is during runtime, you can achieve that using the getClass() method of an object. The getClass() is method of java.lang.Object, which means that every java class has inherited that method. Another technique that you can use is the instanceof operator. When faced [...]