prompt() is used to get the text box.
Example:
prompt("Enter your name :");
A blog about Java technology tutorials and articles. It mainly focus on publishing the Hello world examples/tutorials of Java/JEE technologies. The advanced java technology such as JAX-RS,Jersey,Hibernate,JSF,EJB etc... tutorials are already covered in this blog.
Tuesday, January 5, 2010
How to give Alert/Messsge box in JavaScript?
alert('your message to be popped up');
Example:
< input type="button" value="Example" onclick="alert('your message to be popped up');return true" />
If you open this code with the Browser then you can see a button named with "Example".
If you click on it it will popup a message box with the message 'your message to be popped up'.
Example:
< input type="button" value="Example" onclick="alert('your message to be popped up');return true" />
If you open this code with the Browser then you can see a button named with "Example".
If you click on it it will popup a message box with the message 'your message to be popped up'.
Friday, August 22, 2008
Differences: HashTable Vs HashMap
HashTable Vs HashMap
When to go What?
- Hashtable is synchronized and thread-safe.HashMap is asynchronized and faster.
- HashMap implements Map interface.By using the Map interface it can switched between TreeMap &HashMap.
- HashMap permits the null values as key or value but Hashtable does not.
- HashMap does not guaranteed to store the values in a constant order over a period of time.
- Synchronization can be achieved by the HashMap by using java.util.collections.synchronizedMap(yourHashMap).This feature is added in JDK1.5.
When to go What?
- Is your operation is multithreaded ?: HashTable(less than jdk1.5).
- Is the datatype of key is Integer ? : HashTable has better performance if the data type of the key is Integer.
Thursday, August 21, 2008
Difference between Arraylist Vs Vector
Arraylist Vs Vector
When to use what?
- Vector is synchronous but arraylist is asynchronous.
- Vector & Hashtables are introduced in JDK1.0 but Araaylist & HashMaps are introduced in JDK1.2.
- vector is comparatively slow with Arrraylist.
When to use what?
- If your data is accessed by multiple threads then go for Vector.
- If your list is a local variable then go for Arraylist blindly.
- If your data is accessed by a single thread then go for Arraylist.
Subscribe to:
Posts (Atom)