General Java Questions I
Answer: Java does not provide it, the terminal itself waits until return is pressed
before sending the entered line to Java.
You need to use some platform specific mechanism to change the terminal settings.
Q: Can I pass a function as a parameter in Java? If so, how?
Answer: No, you cannot. But you can pass an object with method and then just use
this method like this:
myFunction (object); // object has method useMyMethod(){ do smth here...}
..
..
somewhere in another place where use this function..
object.useMyMethod();
What is difference capacity() and size() methods for vector?
 What is difference between 
public final int capacity()
Returns the current capacity of this vector.
and 
public final int size()
Returns the number of components in this vector.
Answer: please read this method: ensureCapacity
public final synchronized void ensureCapacity(int minCapacity)
Increases the capacity of this vector, if necessary, to ensure that it can hold at least
the number of components specified by the minimum capacity argument.
Parameters: 
minCapacity   the desired minimum capacity.
 What re the differences between classpath and import in the java application? 
Do I need to have the package in the classpath first before importing in a java
application or need not?
Answer: Classpath is an environment variable of your OS, you have to set it (or
better: Java sets it) to tell Java where to search for classes. 
You use import in a program to let Java search for the specified classes within the
classpath. This implies that the package must be in the classpath.
  
Stephan Effelsberg
 Q: What is difference between Iterator and Enumeration?
First of all Java FAQ Team wish you !!!HAPPY NEW YEAR!!! and then
Answer: from
http://java.sun.com/docs/books/tutorial/collections/interfaces/collection.html
The object returned by the iterator method deserves special mention. It is an Iterator,
which is very similar to an Enumeration, but differs in two respects: 
Iterator allows the caller to remove elements from the underlying collection during the
file:///F|/a_jsite/350_tips/general_java I.htm (12 of 33) [2001 07 08 11:24:51]






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java web hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved