Set significant figures in Java Programming language

Posted on July 8, 2008
Filed Under Java | Leave a Comment

How do i set significant figures in Java Programming language?

Java 1.5 offers a printf-like formatting via java.util.Formatter or via the ‘printf’ method of an output stream:

e.g.: System.out.printf(”%.2f”, (double)100); or
String output = String.format(”%.2f”, (double)100);


Tags:

Comments

Create a Java bean for Drop down menu

Posted on July 8, 2008
Filed Under Java | Leave a Comment

How to create a Java bean for Drop down menu?

in the java bean:
u need to create the element as an array, and fill up the elements.
Have getter and setter for the element

in the jsp, u can just call the array and loop it and display the elements in the array.


Tags:

Comments

Check whether a file is opened or not through java

Posted on July 8, 2008
Filed Under Java | 1 Comment

How do i check whether a file is opened or not through java?

I don’t think you can do that. When you ask java to open the file it can read from it. If you don’t open the file in the code, the Java wont see the file at all. You might want to look at the swing libraries, they might have some file manipulation there. Also, make sure that the file you are opening in the directory where the java can read it. Meaning if it in the same place as the code or the total path of the file.

Tags:

Comments

Add Java Script to my desktop

Posted on July 8, 2008
Filed Under Java | Leave a Comment

How to add Java Script to my desktop?

Java Script is a script, it is text, a javascript file would be a text file. You would open it in notepad. It cannot do anything by itself, it has to be interpreted by a host, which for javascript is usually a web browser. Your description makes me think it is not javascript, but rather a java program which you are trying to run.


Tags:

Comments

Study for the Java programmer certification exam

Posted on July 8, 2008
Filed Under Java | Leave a Comment

How long do you need to study for the Java programmer certification exam?

*programmer* one is just a lot of picky stuff like knowing the differnece between (++i) and (i++). it is knowing the language inside and out.
if you already have a lot of java experience, it will be like the other poster said 2 weeks. don’t think you know everything, i learned a lot!
also it does cover javadoc.

also do the developer cert. that one you have to do a programming assignment. that one can be done in up to a month if you have a job, 1 week if you don’t have a job.

like i found out that “_” is a valid variable name in java, so i can write

int[] $[] = getMoneyArray();
for (int _=0; i<$[0].length, _++) {
System.out.println( $[0][_]– );
}

if you understand my above code, you too can be a certified programmer!


Tags:

Comments