Java Bootcamp: Days 2 & 3
Day 2: The ABCs of Programming
Another easy chapter, and this one doesn’t even have any exercises I wanted to do! This chapter provides a detailed look at the smaller building blocks of Java code, from data types to statements and expressions. Logical operators are introduced and arithmetic/string arithmetic are covered. Not much to say about this chapter other than it saved me from dying of boredom in class today. Har har.
And so we move right along to…
Day 3: Working with Objects
You’ll notice a recurring theme for awhile, I feel. Not much new here, sadly. I learned how to create a new instance of a class, the difference between and interaction with class and instance variables. Learned how to call class or instance methods (oh dot notation, how sexy ye be), nested method calls… All kinds of sexy shit. A very thorough rundown on object references was informative, makes much more sense than referencing in PHP honestly.
Casting and converting was fun, primitive data types was straightforward. Casting between objects (from one object to another or object to/from primitive type) was a bit more involved. Still a bit fuzzy on that but I’m sure we’ll cover it more later. It was nice to cover material I wasn’t really bored with.
But now I’m getting a headache. I think I’m going to give it a break for awhile, maybe read the next chapter in a bit.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.
Comments
Ah-ha, I’ll be sure to include some sample code. But right now it’s literally horribly simple. Like…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import java.util.StringTokenizer; public class TokenTester { public static void main(String[] arguments) { StringTokenizer st1, st2; String quote1 = "VIZY 3 -1/16"; st1 = new StringTokenizer(quote1); System.out.println("Token 1: " + st1.nextToken()); System.out.println("Token 2: " + st1.nextToken()); System.out.println("Token 3: " + st1.nextToken()); String quote2 = "NPLI@9 27/32@3/32"; st2 = new StringTokenizer(quote2, "@"); System.out.println("\nToken 1: " + st2.nextToken()); System.out.println("Token 2: " + st2.nextToken()); System.out.println("Token 3: " + st2.nextToken()); } } |
Even simple code helps commit the stuff you’re reading to memory. Hopefully, I can start posting code samples to go along with my JoS entries, soon. You’re a step ahead of me, there. :D
Yeah, it does help burn a few things into your head. I’m just easily bored, so doing stuff like that above is hard for me. I’d rather be doing interesting things, y’know? But by all means post samples on your blog! It would add more for me to read. :P
Honestly, once you wrap your head around Java, you’ll be 90% there on understanding .NET. Most of the differences are subtle (and non-headache inducing) – whereas the hump of polymorphism and primitives versus reference types you’ll have already completely conquered. Even the base language syntax between Java and C# is 99.9% the same.
The only big day-to-day difference between the two is which functionality is in which class/namespace – and that’s what Google is for.
Keep up the great work at challenging yourself.

Would be cool if you could post some of the sample code you’re playing with in this posts, I’d be interested in seeing the similarities with what I know about .NET. :)