In Objective-C how should I best approximate what in Java I am doing like this:
static private String[] array {"A", "B", "C"};
What I think I need is a simple array that I can index into with some integers. Alternative suggestions are welcome, but bear in mind that if I am getting stuck on this then I am pretty much hopeless anyway...
I can't seem to see the problem with the example code below. For some reason seems to be ignoring the year and saying the dates are the same, as can be seen in the output below. I must be missing something simple.
01/28/2006
01/16/2007
Tue Apr 01 00:00:00 PDT 2008
Tue Apr 01 00:00:00 PDT 2008
done
import java.util.*;
impo...
for me I will answer this question based on my experience.
so if I'm gonna start new project I will use the following technologies:
AndroMDA as MDA framework.
Spring (DI, Interceptors, Quartz, ACEGI, ... etc).
Hibernate.
JSF.
off course you might need to play with some helper frameworks/libraries such as:
Velocity.
CAS; if you nee...
Hello,
I want to create an array of JButtons with the GUI Builder (not actually writing the code, but drawing it). I can only figure out how to change the name of the element, not add it to an array.
Thanks.
...
Hello,
Am wondering if there is any applet which I can use and customize to capture the users screen (windows and mac) in java? I saw jxCapture but it takes only screen shots. I want to use the tool to capture the screen (for screencast) and then export as flv format.
Am wondering whats the best solution for that? Is there any applet/s...
Given an interface or interfaces, what is the best way to generate an class implementation?
interface Vehicle
{
Engine getEngine();
}
@Generated
class Car implements Vehicle
{
private final Engine engine;
public Car(Engine engine)
{
this.engine = engine;
}
public Engine getEngine()
{
return...
I've seen several questions/discussions here about the best way to handle and persist enum-like values (e.g. http://stackoverflow.com/questions/492096/persisting-data-suited-for-enums , http://stackoverflow.com/questions/256978/how-to-persist-an-enum-using-nhibernate ), and I'd like to ask what the general consenus is.
I've tried to sum...
Duplicate:
Best Java book you have read so far
I consider myself as an intermediate to advanced level Java programmer. I am looking forward to buying some books to enhance my current knowledge in Java and programming in general. What would your recommendations be in these areas?
For Java, I heard about Effective Java being prett...
Given the mapped hibernate class:
@Entity
public class MyTestClass {
/* id and stuff */
private Integer aValue;
private Integer bValue;
}
you can do the following with HQL:
Query query
= getCurrentSession().createQuery("select aValue * bValue from MyTestClass");
List<Double> resultList = query.list;
and get the calculated...
Where do JVM Implementations differ (except licensing)?
Does every JVM implement Type Erasure for the Generic handling?
Where are the differences between:
JRockit
IBM JVM
SUN JVM
Open JDK
Blackdown
Kaffe
.....
Deals one of them with Tail-Call-Optimization?
...
Hi There!
I use nested classes for accessing private members in JUnit tests. They are alaways named "TestProxy".
I would like to remove them at Build time using maven2, to not include it into the jar file.
-Is there any configuration option?
-Can it be done with a plugin? If so, a prototype would be nice! ;-)
Thanks
Edit: Why us...
Is there a java library or framework (other than the javax.comm provided by Sun) that is easy to use when accessing serial and parallel ports ( especially RS-232 ).
I need something free that will work both on Windows and Linux.
...
What does following annotation's ElementType means?
@Entity
@Table(table="application")
@ElementType(type=1L)
class application extends Element
...
I have this Java code, and I want to do the same thing in C#:
long now =System.currentTimeMillis()/1000;
...
I have a number of projects running on a Hudson slave. I'd like one of them to run Ant under Java6, rather than the default (which is Java5 in my environment).
In the project configuration view, I was hoping to find either:
An explicit option allowing me to set a custom JDK location to use for this project.
A way to set custom environ...
I'm analyzing the different behaviors between the JTA (Java Transactions API) and the .NET counterpart System.Transactions: the approach is quite different between the two of them.
In fact, Java's version of Transactions seems more a specification, leaving to developers the obligation to implement either the Transactions, TransactionMana...
I have a very simple batch file that lauches a Java app (Saxon) with the simple command "java net.sf.Saxon.transform..."
This app requires java version 1.5.
This batch file will be used by 400+ users who each may or may not have some versions of the JRE installed on their machines.
I had thought that simply installing the most recent ...
This question arise while trying to write test cases. Foo is a class within the framework library which I dont have source access to.
public class Foo{
public final Object getX(){
...
}
}
my applications will
public class Bar extends Foo{
public int process(){
Object value = getX();
...
}
}
The unit test case is ...
I have a multi-module (maven) spring build. All the modules publish some beans, and most also consume beans defined further down the dependency graph. Although most of it is annotation declared beans, almost every module also has one or two xml-declared beans.
Although we have a half-decent solution, but I am really wondering what is th...
I am trying to convert these small math calls to Java from C# and just wanted to make sure that they operate the same way. I added one additional call as it is not supported in Java.
Here is code in C#
public override int CompareTo(object a)
{
EquationGenome Gene1 = this;
EquationGenome Gene2 = (EquationGenome)a;
return Math.Sign(Gene...