This is a read-only archive!


I plan to move to the west coast sometime within a few months, and that means job searching. That means time to hunker down and get this SCJP overwith. I don't know if it'll help me find a job, but it can't hurt me. I'm going to keep track of what I learn here, and I'm going to write about things I found troublesome in hopes that the act of typing it will help me remember, and that I'll have some kind of record of it.

Today I went through one chapter, dealing mostly with Java class/method/member access modifiers. In the practice questions I missed a couple questions, which was depressing after having just studied it for nearly two hours.

One I missed because I didn't know abstract classes can implement interfaces. But it makes sense that when an abstract class DOES implement an interface, it doesn't need to provide all the methods in the interface.

Another I missed due to Java's screwy syntax. Java will supply an implicit public abstract on any methods in an interface, but when you implement those methods in a concrete class you have to specify them explicitly public. Otherwise they revert to default and that means they don't properly implement the interface's methods at all.

Similar to above, I forgot that even though an interface provides an implicit abstract to its methods, and abstract class does NOT. That makes sense after I think about it for a second, because abstract classes can contain both abstract AND non-abstract methods. However given that abstract and non-abstract methods have different syntax themselves (abstract methods end with a semicolon, and non-abstract methods end with curly braces containing or not containing code) you'd think the compiler could figure it out. But nope.

It's amazing how I studied Java for two years at college and I never got these kinds of rules spelled out in so many words. I sort of picked it up as I went. And I took a class on compiler theory / general computer language design theory, which helped IMMENSELY whenever I need to understand things like scoping rules and inheritance rules and parameter-passing methods. I think those very subtle things are one of the more difficult aspects of computer programming, especially because they differ so often between various programming languages.

January 15, 2007 @ 4:20 PM PST
Cateogory: Programming
Tags: College, SCJP, Java