Using JNI can we pass custom data types from Java to C (or vice versa)? I see a mapping of primitive datatypes to types in C however not too sure if we can send across our own data types (e.g. Send across or return an Employee object or something!).
Does anyone overload the equals method in java? The overloaded method will be
public boolean equals(final MyClass myClass)
This will have the benefit of having the relevant comparison part (guts of the method) in another method.
Details are in this blog.
I need to use a few Cyrillic characters in a Java file and in order for Eclipse to allow me to do so I need to change the encoding for that file (currently to UTF-8).
Are there any possible problems that this could cause?
How would one go about proving to management that a batch reformat of all .java files in a large code base (to place the code in compliance with the company's coding standards) is safe and will not affect functionality.
The answers would have to appease the non-technical and the technical alike.
Having played with Linq (to SQL and Objects) as well as the Entity Framework from Microsoft recently, I was wondering what the non-.Net (specifically Java) equivalents are?
Hello,
I am writing a user defined function to DB2 on AS/400 in Java and the strangest thing happen..
I am always getting the same result from the function even when i am changing it, even if i am dropping it and create it again and even when i specify NOT DETERMINISTIC..
Does any one have ever encountered a behavior like that?
Hi,
I'm not quite sure what field to use when adding more than 30 days to a Java Calendar object. Is there any difference in between Calendar.DAY_OF_MONTH and Calendar.DAY_OF_YEAR?
Example:
GregorianCalendar d = new GregorianCalendar();
d.add(Calendar.DAY_OF_YEAR, 90);
vs
GregorianCalendar d = new GregorianCalendar();
d.add(Calendar.DAY_OF_MONTH, 90);
Thanks.
I know in Jython you can do
import java.util.Random as Random
Random().nextInt()
But if I have a class I wrote myself, how can I import it into Jython without putting the class itself in a package? If I have a testclass Test:
public class Test {
public void foo() {
System.out.println("bar");
}
}
that's not inside a package. Can I even import that into jython by using something along the lines offrom Test import Test?
If i make java core dump with gcore then what is the best tool to analyze it? I need to be able make jmap, jstack, jstat etc and also i need to see values of all variables.
Something that can take core dump as frozen JVM.
Hi,
After some serious googleing I found out that the RandomAccessFile-class is not thread-safe. Now I could use one semaphore to lock all reads and writes but I don't think that performs very well. In theory it should be possible to do multiple reads and one write at a time.
How can I do this in Java? Is it possible at all?
Thanks!
I have to burn a java-application on a cd. This application have to run on every windows pc wihtout any installation (also jre shouldn't be installed) before.
Is there a way in Java to find the "Last Fired Time" from a Cron Expression.
E.g. If now = 25-Apr-2010 10pm, cron expression "0 15 10 ? * *" (quartz) should return me 25-Apr-2010 10:15am
I do not care if we use standard cron expressions (like Unix and Quartz) or less popular ones if they can fetch me the correct "Last Fired Time"
I'm a .NET developer learning Java EE. These two concepts seem to serve the same exact purposes in either system.
So which framework gets credit for inventing them?
Hello.
I develop application with Java.
I need to store some initial configuration data in some kind of file.
I want my app to be able to read this data, but I don't want user to do so.
Example : application loads IP from encrypted file. User sees like "dsda@#21da@" so he won't bother doing anything :)
How should I do such a thing?
Thanx!
I have been working with the Swing library for a long time, I'm working on a new project for school and due to the nature of the program it can't look like a generic/boring swing gui. So my question is does anyone know of an interesting java gui library that is not swing or awt?
Hi,
I have a lot of experience in C and Python, but I'd like to pick up some Java. I was curious if there was a "quick and dirty" guide tailored for people with previous CS background. I'd prefer free online resources but appreciate any suggestion.
Thanks,
Brian
Hi,
I'm a beginner in java. I want the logic of the small program.
I have two arrays
array = {a1,a2,a3,a4,a5,,,,,,,,,an}
and
array2 = {b1,b2,b3,b4,,,,,,,,,,,bn}
I want string as:
a1b1,a2a3b2b3,a4a5a6b4b5b6,..........an
Please tell me what will be the logic.
I am actually new to java programming and am finding it difficult to take integer input and storing it in variables...i would like it if someone could tell me how to do it or provide with an example like adding two numbers given by the user..
I want to make a java application software which give the current status/information of the running computer. So, for this, is there any inbuilt/extrnal library present or not?
Can anyone give a simple code which will just. "What is the current status of laptop battery?" or "Is AC adapter is pluged in or not?"
Please help me.
I'm using a MySQL database and accessing it through Java.
PreparedStatement prep1 = this.connection.prepareStatement("UPDATE user_table
SET Level = 'Super'
WHERE Username = ?");
prep1.setString(1, username);
The update statement above works fine however I'd like to get the number of rows affected with this statement. Is this possible please?
I have line in JAVA and in while i get number:
i = gzipinputstream1.read(abyte0, j, 4096);
From while number:
959
1552
1577
1617
1680
when i want use in php:
$i = fread($handle, 959):
while return:
959,
959,
959,
5
How make that in PHP result will be the some. thanks
More of a wiki list/collection, I'm looking for a list of good Java desktop apps. I've added a couple below to get started. Please list the framework/widget toolkit being used if it's know as well.