TIJ chapter 6: Access Control

This chapter is not a complex one. It just tells the access control involved in Java.

There are 4 access level in Java, public,  protected, package-private, private. (By accident they all start with letter “p”). Package-private is the default one without any modifier. The only thing one should note is the protected access level implies package-private ones(Actually this is true for all 4 levels, one implies the other one by order).

If one doesn’t allocate a package for a class, this class will belong to the default package. Default package in a same directory is viewed as one package. read more

TIJ chapter 5: Initialization and Cleanup

This chapter is really the beginning of OOP. I think Java is really designed with the concept of OOP. Even those process oriented programming elements are forced to be absorbed in that systems and become static element. If in one day, which may not be too far away, OOP are no longer popular, Java would either.

Ironically, we always had to have some place to start up a program, and that place can’t be an non-static method, at which no object has been created since it is the beginning. So, the starting point is always a static method, either main() method or something else in JUnit or things like that. In that static method, we can call other static methods or create new objects and run non-static method on that. However, every static method cannot go beyond classes. read more

SSL certification deployed

Today I deployed SSL certification on my blog. As a result, my blog is only available from HTTPS, and all attempting from HTTP will be redirected to HTTPS. To do this, just add this to the Apache2 available sites configuration, like this:

<VirtualHost *:80>
	ServerName aleph0.me
	Redirect / https://aleph0.me/
</VirtualHost>

A small vignette is that they give me a mismatch cert after I receive this message from Namecheap. Apache refused to restart, then. So, I had to ask them to reissue my cert. read more