Monday, September 23, 2013

Simple Encapsulation in Java

Last week I was taught about Encapsulation by my teacher.I've been knowing encapsulation when i started to read e-book java which is SCJP for Java 6.That's a good book to understand deeper about java.I suggest you to read the book.

Today i'm gonna show you how to make your class to use encapsulation concept.First of all you have to understand why we must use encapsulation.Sometimes you create a class and you don't want some fields to be accessed by other class.There is a way to make your field cannot be accessed.You can use access modifier "private".Look at the code example :

Monday, September 16, 2013

Pass by Value and Pass Reference by Value

The basic of OOP(Object Oriented Programming) is to understand what is Object and Class.Simply in java programming object is a representation from a class that has a behavior and a state that can be assigned a value.A class is the blueprint from which individual objects are created.It's a little bit confusing for now if you haven't learnt them.You can read them at here as a reference

It might be at your school you got the lesson,but you still didn't understand so you're trying to look for it in the internet.I hope this post will help you understand it clearly.The best learning of programming is to try a example program and to figure it out.When i am studying about programming i always write a example program and think how the program works.

Tuesday, September 10, 2013

What is the Difference Between Prefix and Postfix Operators in Java

When I was learning Java at my school.I was taught about flowchart and pseudocode before I entered the syntax of java language itself.I knew Java at my school when my teacher taught me about algorithm.If you don't understand java,which is programming language,you can learn more here.I'm really exiceted to learn it because it is cross platform and high level programming.