Hi.
I wanted a thing like I declare a variable: String a = "test";
And want to know what type it is, i.e., the output should be java.lang.String
thanks in advance
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?
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.
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.
Hi all,
I need to create daemon that will monitor certain directory and will process every file that's written to that particular path.
My choice is either java or python.
Did you guys have any experience using both technology? what is the best one?
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?
In my code I am using java.sql.PreparedStatement.
I then execute the setString() method to populate the wildcards of the prepared statement.
Is there a way for me to retrieve (and print out) the final query before the executeQuery() method is called and the query is executed? I Just want this for debugging purposes.
Thanks.
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.
Is there a simple way to have your "Service Layer" deployed separately from your web layer, so that I can reduce the number of times per week that I have to, package, build and deploy the entire WAR file?
I'm using Tomcat mostly, but I'm hoping for something more generic to Java web servers
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
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?
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?
This problem occurs over and over. I have some complicated object, such as a Cat, which has many properties, such as age, favorite cat food, and so forth.
A bunch of Cats are stored in a Java Collection, and I need to find all the Cats that are aged 3, or those whose favorite cat food is Whiskas. Surely, I can write a custom method that finds those Cats with a specific property, but this gets cumbersome with many properties; is there some generic way of doing this?
Why is it that in Java, a superclass' protected members are inaccessible by an indirect subclass in a different package? I know that a direct subclass in a different package can access the superclass' protected members. I thought any subclass can access its inherited protected members.
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..
What is the best procedure for storing and retrieving, using native Java serialization, generic objects like ArrayList<String>?
Edit: To clarify. When I serialize an object of type ArrayList<String> I'd like to de-serialize to the same type of object. However, I know of no way to cast back to this generic object without causing warnings.
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 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?
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.
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 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
hi all...
i had created 8 tabs in tabbed panel using java swings. the problem is when i enter data in any tab and click the save button. after clicking it leaves the present tab/panel and going to first tab.
i have to retain on the same tab after clicking the save button..
so please help me on this
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.