Luciano Mantuaneli

Greenhorn
+ Follow
since Dec 04, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Luciano Mantuaneli

By the way, Thread.stop is depracated:
http://java.sun.com/j2se/1.4.2/docs/guide/misc/threadPrimitiveDeprecation.html

A simple way to have some control if the finally is executed or not - its content, at least - is to use a boolean control variable:
14 years ago
I made this test and the instances seems to work independently...
14 years ago
If you really want to do this:
  • Create an java.util.Properties object
  • Load your property file into the Properties object
  • Create an TreeMap object, passing to its constructor your Properties object
  • Use a simple for strategy to output the key-value pairs of the TreeMap objecto into a String object
  • write that String into your file

  • Have Fun!
    14 years ago
    I guess there is no such thing in Java...
    14 years ago
    If you don't bother in receive those convertions in a String format, you can use the Integer's methods:
  • toBinaryString(int)
  • toOctalString(int)
  • toHexalString(int)
  • However, if you declare an int variable and atribute a number prefixed with the zero digit, you assigning an actal value. The same happens for an hax value, if you prefix the number with "0x".

    14 years ago
    I guess thera are some misunderstanding here...
    A Java compiler receive a .java file and "spits" a .class file. The .class file have the bytecode. So, the Java compiler transforme java text in bytecode text.
    A JVM interprets the bytecode contained in the .class file to the OS/Machine for which that JVM has been created. A JVM for windows, interprets a .class to windows systems, etc.
    14 years ago

    Originally posted by Jesper Young:

    Luciano, please don't post the complete solution - that way Jalli will not learn anything. Have you read the description of the beginner forum? It says:


    Got it!

    14 years ago
    First, refere to the java.util.Arrays documentation
    Then, if have questions about it, ask us here!
    Have fun!
    14 years ago
    what syntax exactly you don't understand?
    14 years ago

    Originally posted by Keith Lynn:
    Starting with JDK 1.4, the String class has a method called split() that will split the String into an array of tokens using a regex as delimiter.



    This approach can be very tricky: Depending on your regex, you may have distorted values
    [ December 04, 2006: Message edited by: Luciano Mantuaneli ]
    14 years ago
    It has to be pseudo code? Because I know a solution using features too specific of Java API. Can't see how to express it in pseudo code... Let me try:

    If you want to see the code, let us know!
    14 years ago
    Although you don't posted how you try to print your result, I can guess you made it like this:

    If you done something like that, you will have in your console the 12.1666 value indeed. You have to know that the format method don't modify the parameter.
    Try something like this:
    14 years ago
    There is many approaches. I'll give you two.
    1) If your String array is sorted, you can use the java.util.Arrays' binarySearch method:


    2)You can use an temporary java.util.List object created from your array and use the indexOf method


    Hope it heps you!

    PS.: Note that, in both cases, if the position variable hava an negative value, it means that myString wasn't found in myStringArray array
    [ December 04, 2006: Message edited by: Luciano Mantuaneli ]
    14 years ago