What is the default capacity and load factor in Java Collection? Explain its role.
Latest Answer: Default Capacity of any Collection say HashSet is 16. It means when you create a HashSet using its default constructor then first HashSet will be created to hold 16 elements or you can say that memory space is allocated to hold 16 elements.load ...
What happens when you add a double value to a String?
Latest Answer: When you add Double value to a String first the double value will be converted to String and appended to original String and new compelet String object will be created.For exam:String str = "Ram";Double d = new Double(12.50d);str = str + d;now ...
Why we prefer a subclass of Frame over an instance of Frame when we creating a window?
Latest Answer: One important reason would be to override the existing paint method which will work only if we subclass Frame and not create an instance of the frame.However since extends is such a premium in java, we should not waste it by simply subclassing Frame but ...
How do you implement ArrayList without using Collections in Java?
Latest Answer: def size=10def loadfactor=0.75def myarray = Object[size]def cursor=0def threshold = (int)(size * loadfactor)def add(obj) if cursor < threshold myarray[cusror++] = obj else ...
What is the need of nested and inner classes in Java? Explain where they are useful?
Latest Answer: Using Inner classes you can write more efficient code and even reduce the typing work. Inner classes are frequently used in Event Handling. For example to MouseEvent event is handled in following example:import java.applet.*;import java.awt.event.*;public ...
50,000 HTML files are in a folder on a windows machine. Among them, content of some files(not the file names) contain the sentence "SocioMaC-Jus' Follow!". Write a Java program to count
Latest Answer: If you need to _search_ random strings - use lucene. Otherwise i think sarje has the answer. Can you not write the text parsing in the file filter ? ...
50,000 HTML files are in a folder on a windows machine. Among them, content of some files(not the file names) contain the sentence "SocioMaC-Jus' Follow!". Write a Java program to count
What is the basic functionality of DataOutput interface in java?
Latest Answer: The DataOutput interface provides for converting data from any of the Java primitive types to a series of bytes and writing these bytes to a binary stream. ...
what do exception mean in java ? what type of run time exceptions?
Latest Answer: Exception means an unwanted condition occur during the excecution of a program.Exception are of two type
1) Checked Exception2) Unchecked Exception
Checked exception are those exception which can be checked at compile time such as NumberFormatException
Unchecked ...
I would like to create a PDF file using java and iText , getting data from the database.I am looking for examples.
Latest Answer: better to use this packageimport com.lowagie.*; ...
View page [1] 2 3 4 5 6 7 8 9 10 Next >>

Go Top