Valentin Mone

Greenhorn
+ Follow
since Nov 05, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Valentin Mone

Ok, seems people is out on vacation, or does not have time for answers .
Just so you know, problem was that "charsets.jar" was not in the JRE/lib directory. If you have this problem, copy jar to that folder and problem is solved. I got the jar file from /jdk/jre/lib.

Cheers
Valentin
17 years ago
A thing that i've noticed is that the csv file contains also english words (for the 3 column names), number for first column, and the remaining 2 columns contains unreadable text(which is the japanise text). So is it posible for a file to be partially encoded with UTF-8, and partially encoded with Shift_JIS? If so, how do I parse it?
[ July 24, 2007: Message edited by: Valentin Mone ]
17 years ago
Hi,

I'm kind of new to String encoding and I have the following problem.
What I have to do is to parse a csv file, which the one who made it said is encoded with SHIFT_JIS, and I open it this way:


The problem is that it crashes when file is opened with java.io.UnsupportedEncodingException: SJIS.
Any help is appreciated. Thanks.
17 years ago
Hi,
I'm not a guru regarding threads , but here is what i think. First of all if your code is executed by multiple threads you must synchronize your code, so that at any given time only one thread executes a piece of code (in your case the for loops in which you print the values). You want every thread to print an address?
Hi Abdul,
My opinion is that you don't have to worry so much about Math class. As one who took scjp 5.0 exam, i don't remember to have seen questions related to this, and if they are they won't require you to know all the api for this class, but only the most used (random for example). I think you should focus more on collection/generics, IO, OOP.... this will save your but, and not Math class.

Cheers,
Valentin
Daniel, I think he he wants us to make it work without making any change to the code....
Hi,
I think the answer is 15: First x is assigned new Double(0) ... untill now everything is clear , than follows two "for" nested loops and every iteration creates a new object and assigns it to x, thus with each iteration a new object is available for GC (except for the one created in the last iteration).
none of them compiles to me: A.B ob= A.new B();, nor A.B ob= new A.new B();
what is wrong?
this is a good one ... personally I don't think it's possible to get that output.
[ November 14, 2006: Message edited by: Valentin Mone ]
Hi,
Boxing will always be chosen over varargs...that's why show(Object o,Object o1 )is called.
widening beats boxing and varargs, and boxing beats varargs. In your case int is boxed to Integer...than widened to Object. Hope this helps you.
[ November 13, 2006: Message edited by: Valentin Mone ]
Hi,
I guess you are not using jdk 1.5. Autoboxing is a new feature that allows you to write code like that; Beyond the stage there is a "new" happening...but it's hidden.
Hi Bert,
can you be more specific? as I don't know what you mean...
Hi,
Can somebody explain to me why the folowing code does not compile?
\
Why am I not allowed to declare the variable before the for statement? A normal for loop allows you this.

Thanks,
Valentn
actually my question is ... what is the thing with primitives pool?
Short x=5; will be created on the heap? or some pool just like String does?
Hi fellows,
This class below was posted for a garbage collection topic but I'm having question related to this:

CODE] CardBoard {
Short story = 5;
CardBoard go(CardBoard cb) {
cb = null;
return cb;
}
public static void main(String[] args) {
CardBoard c1 = new CardBoard();
CardBoard c2 = new CardBoard();
CardBoard c3 = c1.go(c2);
c1 = null;
// do Stuff
}
} [/CODE]

So.. how many object are garbage collected after //do stuff?
c1 will be, so 1 object is for sure... but will "story" count also? Will "story" be garbaged collected? stay tuned ...

Thanks,
Valentin
[ November 11, 2006: Message edited by: Valentin Mone ]