Possible Duplicate:
How will I know when to create an interface?
Why do we need interfaces in Java?
Instead of interface can't we write the methods directly in the class itself?
Why do we need a separate interface?
Using Java have the source code of a webpage stored in a string. I want to extract all the urls in the source code and output them. I am awful with regex and the like and have no idea how to even approach this. Any help would be greatly appreciated.
I need to supply a binary license file to a java program. What is the best way to do this? The data will change all the time so I don't want to have to write a file and then read it back every time.
The Data is coming from a PHP page
I need to create a Set of objects. The concern is I do not want to base the hashing or the equality on the objects' hashCode and equals implementation. Instead, I want the hash code and equality to be based only on each object's reference identity (i.e.: the value of the reference pointer).
I'm not sure how to do this in Java.
The reasoning behind this is my objects do not reliably implement equals or hashCode, and in this case reference identity is good enough.
Hi All
I am a C sharp Programmer.I Want Learn Java to Implement My Windows Application.But i Don't know What IDE and What Tools Can Help me.
Please Help me to Choose Best PlatForm And IDE and Other Tools.
In Java, I want to download some data asynchronously in a Thread (or Runnable) object, and have the Thread put it's data into an Object I've declared within my main Thread.
How could I do this please?
hi, im currently learning stacks in java and have a quick question. what will the following code display if the stack is empty? my guess would be "true"?
System.out.println(st.isEmpty());
Java ME is quite sparse on features. Are there any libraries you use to add missing features?
I don't want to focus on UI libraries - these are better discussed here.
Hi guys,
Just wondering if you could help wanting to produce an activity stream in Java, the idea was to have a JLabel and text area followed by a divider be displayed on a screen and then repeated X amount of times according to what data was in a database.
What I was wondering is how could I possibly repeat the placing the jlabel, text area, and diveder on the screen above the last rendered objects on the fly and all displayed correctly no matter the size of the text area of each set of object sort of like the image below.
Hope I made it clear as I could thanks
I'm developing a multiclient-server program with Java based on GUI and database. The demand regarding the program from the client side is to make sure all the time that there is a connection to the server, and if the connection is lost (server goes down/problem with socket or stream) it should be notified.
In other words I need a solution for continuously checking the connection to the server.
What is the best way to do that ?
I'm trying to represent the port number 9876 (or 0x2694 in hex) in a two byte array:
class foo {
public static void main (String args[]) {
byte[] sendData = new byte[1];
sendData[0] = 0x26;
sendData[1] = 0x94;
}
}
But I get a warning about possible loss of precision:
foo.java:5: possible loss of precision
found : int
required: byte
sendData[1] = 0x94;
^
1 error
How can I represent the number 9876 in a two byte array without losing precision?
Guys, simple situation -
read a json file
discover all key-value pairs
compare key-value pairs
I tried gson, package from json.org, but can't seem to get far with it.
Can someone please provide a clear sample in Java on how to take a file, read it, end up with json objec i can get key/value pairs from
thanks so much
Is it possible to start other application that are installed on the system with my java app and pass a file as a parameter to them? I have a client which receives videos from a server and I want my client program to start, lets say the VLC player with the file that I received. How do I manage to do that?
I need to insert many small rows rapidly into Oracle. (5 fields).
With MySQL, I break the inserts into groups of 100, then use one insert statement for every group of 100 inserts.
But with Oracle, user feedback is that the mass inserts (anywhere from 1000-30000) are too slow.
Is there a similar trick I can use to speed up the programmatic inserts from Java into Oracle?
hi,
Friends I need to configure my project with JDK 1.6 version.In this project I have to use tomcat server which version of tomcat is compatible with Java 1.6.
I'm learning Spring MVC at the moment and comparing it to ASP .NET MVC. Is there a way to use partial views in java (like .ascx partials in ASP .NET MVC), so i can associate it with action method of some controller and pass model data to it.
Why did Sun (now owned by Oracle, I know) develop the Java Plaform? How does it make business sense? It seems to me like it would be a very expensive project (also, any ideas on how much they spent/are spending to develop/maintain the platform?). Are they making money by selling support or something?