When there is no methods in the marker interface, then what is the use of marker interface. What is the functionality of the interface. Why do we need to implement marker interface?
Latest Answer: Marker interface do not have any method. It is used only to inform JVM that such class can do some special function like clone, serialize. ...
What are all the methods used for Inter Thread communication and what is the class in which these methods are defined?
Latest Answer: Three methods are used. They are1. wait() - makes one thread wait for some time till another thread is being executed2. notify() - makes one wait process into ready state process3. notifyall() - makes all the waiting processes into ready ...
In how many ways we can create an object? Explain with example.
Latest Answer: There are 5 ways:1-> new operaotor2-> Class.forName()3-> Cloning4-> Deserialization5-> Class.newInstance() ...
What is the meaning of supplying string[] args to main method?
Latest Answer: public static void main(String args[]) This array of Strings is the mechanism through which the runtime system passes information to your application. Each String in the array is called a command line argument. Command line arguments let users affect ...
An array A is of size N. Write a java method that jumbles all values in the array. All possible permutations must be possible and chances for each possible permutation must be equal. For example, size
Latest Answer: class jumble{public stativ void main(String aa[]){int a[]=[1,2,3];for(i=0;i
Suppose a Super Class method throws an exception and this method is Overriden in the subclass with no exception. Now if you create a super class reference that has a subclass object. This throws a compile
Latest Answer: class Super { void foo() throws NullPointerException { System.out.println("Super"); } } public class SupSub extends Super { void foo() { System.out.println("SupSub"); } public static void main( String[] argv ...
What does "wrapping" an object mean?
Latest Answer: When an object A is said to "Wrap" object B, it means that Object A HAS A reference to the Object B and deligates calls to it. ...
How to pass commandline arguments in main function through Eclipse Tools (editors).
Latest Answer: Click the Run menu barNow click the Open Run DialogueA new window will be opened.In that window click the Java applications thenA new sub menu will be opened in that select Arguments menu andType the Arguments with space.Click run to view your result ...
How many methods to read numbers and characters and what should be used.
Latest Answer: methods in InputStream to read byte and in Reader to read character are -int read()int read(byte buffer[])int readIbyte burrer[],int offset,int numBytes) ...
I'm trying to write an Iterator class for a LinkedList class that I wrote.One of the methods is "public E next()"I try to return an "E" but eclipse says "cannot convert from
Latest Answer: Object is a class and E is a generic type parameter . And Iterator class alwayes return Object so to fix this problem, you need to call it. For exampleimport java.util.ArrayList;import java.util.Iterator;class list { ArrayList list = new ...
View page << Previous 1 [2] 3 4 5 6 7 8 9 10 Next >>

Go Top