What is JAVAdoc utility?

Javadoc parses comments in JAVA source files and produced HTML pages for the same. Below is the syntax for the same javadoc [ options ] [ packagenames ] [ sourcefiles ] [ @files ] Arguments can be in any order. Options Command-line options that is doctitle, windowtitle, header, bottom etc Packagenames: – A series of … Read more

What is a StringBuffer class and how does it differs from String class?

StringBuffer is a peer class of String that provides almost all functionality of strings. String represents fixed-length, immutable character sequences. Comparatively StringBuffer represents mutable, growable and writeable character sequences. But StringBuffer does not create new instances as string so it’s more efficient when it comes to intensive concatenation operation. In Core Java, the StringBuffer class … Read more

What’s the main difference between ArrayList / HashMap and Vector / Hashtable?

Vector / HashTable are synchronized which means they are thread safe. Cost of thread safe is performance degradation. So if you are sure that you are not dealing with huge number of threads then you should use ArrayList / HashMap.But yes you can stillsynchronize List and Map’s using Collections provided methods :- List OurList = … Read more

Can you explain the core collection interfaces?

There are six interfaces and come under two different inheritance group one which comes under the collection interface root and the other in the map interface root.   Collection It’s the base of all collection classes. It provides a unified way to manipulate collection objects. Collection has group of object called as elements. These elements … Read more

How can you copy one array in to a different array?

System.arraycopy(myOldArray, 0, myNewArray, 0, length);+ In Java, you can copy one array into another using various methods. Here are a few common ways: Using a loop: You can iterate through each element of the source array and copy it to the corresponding position in the destination array. java // Example with int arrays int[] sourceArray … Read more