What are all the methods used for Inter Thread communication and what is the class in which these methods are defined?
Latest Answer: Inter thread communication is done using wait and notify (or notify all). These methods are defined in 'Object' class. ...
In how many ways we can create an object? Explain with example.
Latest Answer: In Java objects can be created in 4 ways.1. using new operator2. First get class reference either using Class.forname or class loader. On this class, create object using 'newInstance' method.3. Clone4. Deserialization ...
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: void jumble(Object[] A) { Random rand = new Random(System.currentTimeMillis()); Object temp; for (int i = 0; i < idx =" rand.nextInt(A.length);" temp =" A[idx];">
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: "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: Because at run time, the ...
What does "wrapping" an object mean?
Latest Answer: Wrapping an object means we are covering that object, say for example in Java we can say String is a class as well as String is a data type.String s;  // here s is object of String class    String.valueOf(12) // here String is a class , valueOf() ...
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.
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 having a reference of one variable store in stack whereas "E" is created in a heap don't have a reference variable ...
what is the use of static data member?
Latest Answer: Static Data Member is used when the user wants only a single copy of the object and that data member can only be initialized once. ...
No comments:
Post a Comment