When you are customize the magento site you may be want to get current category,root category and sub category details like category ID,name,…etc.Here is a simple example.

If you want to load known category details ,for a example want to load category id=10, details.That is like this.