Wednesday, November 22, 2006

same package different folders

you can have test classes and the source code classes in same package but in different folders. Thats cool, look at the example

C:\myApps/mycode/mainsource/com/tamaash/tds/dblayer/someclass.java
package name - com.tamaash.tds.dblayer for someclass.java

C:\myApps/mycode/test/com/tamaash/tds/dblayer/testsomeclass.java
package name - com.tamaash.tds.dblayer for testsomeclass.java

There will be two entries in the classpath.
C:\myApps/mycode/mainsource [and] C:\myApps/mycode/test

Tuesday, November 21, 2006

Throwing Exception in Java

Just a note of caution while throwing Exceptions, You can;t throw them from a catch Block.
A good article on Exception is here - http://www.artima.com/designtechniques/exceptionsP.html