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());
Can anyone recommend a good Java JSON library (better than the one from http://json.org/)? I've also found JSON-lib, which definitely looks like an improvement, but I'm wondering if there is anything that is even better than that?
I am trying to execute a query in oracle db.
When i try to run thru SQLTools the query is executing in 2 seconds
and when i run the same query thru JAVA it is exectuting in more than a minute.
I am using a hint /*+ordered use_nl (a, b)*/
I am using ojdbc6.jar Is it because of any JARS?
Please help whats causing this?
I have an Java class, like Library, that contains many fields. I want do ajax call to server
and in controller's method I want to have partly initialized @RequestBody Library with only
fields, which are present in json object.
Please Help
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?
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?
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 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.
When I do System.out.println(map) in Java, I get a nice output in stdout. How can I obtain this same string representation of a Map in a variable without meddling with standard output? Something like String mapAsString = Collections.toString(map)?
Hi,
I'm having a bit of a strange problem with an application using the Files.probeContentType(path)-method to test for file type: On both my Ubuntu and Fedora systems, it works fine, but when moved to a RedHat Enterprise server (2.6.18-194.el5 #1 x86_64 x86_64 x86_64 GNU/Linux), it only returns null. I'm using java 7 early access (1.7.0-ea-b84). I have to use this version due to functionality that isn't included in 1.6.
Does anyone have an idea of what might be the problem here?
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?
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.
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
Hi All
I want to generate image on server side. My Image is stored in server side's database in blob format and I am able to convert it into string_image;
Then How to convert that string_image into actual .jpg or .png format.
Actually I am posting attachment as image on users facebook' wall.
How to generate Image at server side in Java?
Is there any sample code to do it?
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
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.
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?
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?
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.
In a set of radio buttons of the same group, only one can be selected at the same time. I would like to have the same behaviour with a normal button.
Imagine there's a row of 3 buttons. When a button is selected it changes: but.setSelected(true) and the other two buttons should be NOT selected: but.setSelected(false)
Now, is there a generic, simple and clean solution to accomplish that in Java (Swing) ?
I've been trying to explain Java threading to a colleague who has never been exposed to multi-threaded applications, but apparently I'm not a very good teacher.
Can anyone recommend a good online or offline resource that can explain threading in a simple, step-by-step manner? I know it's a complex topic, but surely there exists an article, book, or other explanation that can result in an "Aha! I get it, finally!" moment.