Fyodor Sherstobitov

Greenhorn
+ Follow
since Feb 21, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Fyodor Sherstobitov

Hi!
You can consider a List as an array with the ability to change size and some additional features.
Set (and HashSet as one of it implementations) is just a List in which you can't put two or more same items.
In both List and Set indexes are generated automaticaly. If you have a List of 3 items, indexes would be 0, 1, 2 and no other.
On the other hand, in Map (and HashMap as one of it implementations), you can assign a value to any key (index) you want to. You can have HashMap<Integer, String> of 3 key-value pairs with keys (indexes) 35, 115, 1024.
11 years ago
Thank you all, guys, for your replies.
12 years ago
Static methods and variables belong to the class, not the instance. This means that you can access it with no need to create an object of class using ClassName.staticVariable of ClassName.staticMethod() constructions.
12 years ago
The 3rd edition covers only the features of Java 1.2, while the 7th is about Java 1.6. The basics of the language are the same, but there are many differences in libraries. For example, the java.util.concurrency was added in Java 1.5 and you wouldn't know anything about it when you've done with the 3rd edition. I recommend you to buy a newer edition.
12 years ago

Campbell Ritchie wrote:How much programming did you do while you read the book?


I've completed something like the half of the exercises of Thinking in Java.
12 years ago
I've read the book or two about the Java. Have a become a programmer? I don't think so. What have I do next? I think, I must get some practice. Where can I get it? For example, involving in an open source project. But most of them are too difficult for me and any other beginner. So, this is my question. Can you recommend any source of programming experience for the beginner?
12 years ago
I think, that in case of large amount of variants in conditional loop, the switch/case variant is preffered. For example, you have 100 variants to choose from. You are entering your for loop and looking the first if statement is true or false. If it is false, you are looking the second one, and then the third and then... Until the condition is true. In the worst case this will be 100 computations. Now lets see, what we have in case/switch statement. You are entering the for loop, comparing your number with switch condition and just jumping to the piece of code you need. In the worst case this will be 100 times faster, than with if/else construction. In the best case it will be the same.
13 years ago
Hi!
serialVersionUID is used by Java Serialization mechanism to detect if the target object was modified during serialization/deserialization process. If you will try to cast deserialized object to it's original type and JVM will see, that serialVersionUID differs in class definition and in inctance variable of an object, it will cast InvalidClassExceptions.
The problem with autogenerated serialVersionUID is that it is being generated on the base of some iformation about the class that JVM has and may differ from one version of JVM to another, so you can have collisions serializing your objects on one system and trying to deserialize them on other.
13 years ago
Hi!
Excel works with .csv files pretty well, so you can merge two .csv files by copying and paseting them from one file opened in Excel to another.
13 years ago