How to Enable remote debugging of a java application

Friday, 8 June 2007, 2:50 | Category : Java, Technology
Tags :

While running the application pass following as JVM argument -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8765 This will start listening on port 8765, now you may attach remote debugger from any machine giving the IP/hostname and port.

Executing Javascript in Java code

Monday, 4 June 2007, 13:52 | Category : Java, Javascript, Technology
Tags :

you need follwing libraries to use javascript code in java. 1. Apache BSF : http://jakarta.apache.org/bsf/ 2. Mozilla Rhino : http://www.mozilla.org/rhino/ Sample Code:

Class Loading in Java

Friday, 27 April 2007, 14:09 | Category : Java
Tags :

Class loaders are hierarchical. Classes are introduced into the JVM as they are referenced by name in a class that is already running in the JVM. So how is the very first class loaded? The very first class is specially loaded with the help of static main() method declared in your class. All the subsequently […]

Reading Mails from secure exchange server in Java

Thursday, 26 April 2007, 16:46 | Category : Internet, J2EE, Java, Technology
Tags : , ,

1. Export the certificate for the exchange server from Internet explorer Certificate export wizard e.g. after opening https://webmail.hostname.com, (View certificate >Details > Copy to File). Say the exported file name is certificate.cer 2. Create keystore from the certificate using java keytool (which will create keystore file in current directory). It will ask for a password, […]

Number of processors on a machine

Monday, 23 April 2007, 23:20 | Category : Java, Technology
Tags : ,

How to get Number of processors on a machine in java

Sample java code to read mails from your gmail account

Monday, 23 April 2007, 23:13 | Category : Internet, J2EE, Java, Technology
Tags : ,

Sample java code to read mails from your gmail account

Covariant return types

Friday, 20 April 2007, 12:44 | Category : Java, Technology
Tags :

You cannot have two methods in the same class with signatures that only differ by return type. Until the J2SE 5.0 release, it was also true that a class could not override the return type of the methods it inherits from a superclass. In this tip you will learn about a new feature in J2SE […]

Java Interview questions

Friday, 20 April 2007, 12:41 | Category : Interview questions, Java, Technology
Tags :

Q. How to create Immutable class? Immutable objects are simply objects whose state (the object’s data) does not change after construction. Always construct an object completely, instead of using a no-argument constructor combined with subsequent calls to setXXX methods. Do not provide any methods which can change the state of the object in any way […]