I am developing a online Content Management site.In which I want to allow user to upload their articles via a doc file.so, now i want to read text from that text file and if user want they can save their articles to a doc file.so, kindly tell me which API to use for this functionalities.It is preferred to have free API.but all suggestion...
As in C++ iterator.remove() is not 100% safe or robust
does java guarantees 100% robustness with iterator.remove()?
...
I am having some issues with generating Java Classes with appropriate JAXB annotations from an XSD using XJC.
I have a relatively simple XSD file defining my XML schema. The complex types within the XSD take advantage of inheritance using the tags. The problem I having is that I need all complex types to generate Java Classes with the ...
This question is more or less the same as Restrict Certain Java Code in a Plug-In, however the accepted answer was simply to further search with Google, what I already did without having this question answered.
Effectively, I want special security constraints only for code I load via plug-ins.
When a plug-in is loaded and started, all ...
In Java, an Object can have a runtime type (which is what it was created as) and a casted type (the type you have casted it to be).
I'm wondering what are the proper name for these types. For instance
class A {
}
class B extends A {
}
A a = new B();
a was created as a B however it was declared as an A. What is the proper way of r...
What is, currently, the best choice to run MIDP applets in a Windows CE based System?
...
Hi, I understand that Java associates a lock with every shared object to ensure mutual exclusion and condition sync. I am told to model a Java recursive lock as a FSP process.. but I'm stuck and below is the question and what I've written so far. HELP IS GREATLY GREATLY APPRECIATED.
QNS: Given the following declarations:
const N = 3
ra...
This is compiling fine :-
public class Demo {
public static void main(String... args) {
}
}
But this is not getting compiled.
public class Demo {
public static void main(String... args) {
String... strVarArgs ;
//here i initiallize strVarArgs by some logic, like we do for arrays
}
}
Plz correct m...
I have an interface A, which class B implements.
The following generic method works
public static <T, U extends T> List<T> listFactory(Collection<U> source) {
return new ArrayList<T>(source);
}
but
public static <T> List<T> listFactory(Collection<? extends T> source) {
return new ArrayList<T>(source);
}
does not (compilation err...
I have some 1000 key-pair values that I will use in my j2me application, reading it from a resource file. However I will be using only a few of those values at any time, say 10, based on the record number being generated inside the application logic. Loading all the values into memory and then looking up is fairly not an efficient option...
Hi,
I was going through data structure online class and it was mentioned that linked list and array are fundamental data-structures and so my question is about Hash table, Heap, tree and graph are those not fundamental data structures and if not are they derived from any other data structure ?
Thanks.
...
What are the limitations when modifying classes in rt.jar. I realize this is generally specific to the version and vendor of the JRE. I've found that Hotspot in the Sun 1.6 VM, for instance, doesn't like if you add fields to java.lang.Object as it has hard-coded assumptions about the size of Object. However, if I modify significant po...
Can you use an instance initializer with a generic HashMap?
I found this code online, but am having trouble converting it to a generic HashMap instead of a basic HashMap:
someMethodThatTakesAHashMap(new HashMap(){{put("a","value-a"); put("c","value-c");}});
...
I have some static initializer code:
someMethodThatTakesAHashMap(new HashMap<K, V>() {
{
put("a","value-a");
put("c","value-c");}
});
For some reason I am receiving a warning from Eclipse:
The serializable class does not declare a static final serialVersionUID.
Is this complaining about the anonymous class? What can I do about...
How can I store the messages which I've written through javamail into MySql table? I already configured james server config file to connect to mysql server(with datasource element name maildb), and I changed the element in James server config file to
<inboxRepository>
<repository destinationURL="db://maildb/spammer/"
...
I know that if you compare a boxed primitive Integer with a constant such as:
Integer a = 4;
if (a < 5)
a will automatically be unboxed and the comparison will work.
However, What happens when you are comparing two boxed Integers and want to compare either equality or less than/greater than?
Integer a = 4;
Integer b = 5;
if (a == ...
hi All,
I have a sort of complex problem like below.
- we have a real time system with large number threads requirement. In order to optimize the performance, we are thinking of following design.
create a thread pool executor with max number of threads
each thread is used to create scheduled executor service.
now the tasks a...
Given an Applet object, is it possible to programatically obtain a "screen shot" of the applet window (represented as say a BufferedImage)?
JApplet applet = this;
// ... code here ...
BufferedImage screenshotOfApplet = ...;
...
Will the Eclipse compiler automatically convert multiplication by a power of two into a bit shift, or should I do that manually? Thanks for the help.
...
I've heard that using while(true) is a bad programming practice.
So, I've written the following code to get some numbers from a user (with default values). However, if the user happens to type in -1, then it will quit the program for them.
How should this be written then without a while(true)? I can think of a condition to make the w...