STUDENT! LOVE, CARE, and KEPO about TECHNOLOGY! WHAT ABOUT YOU?
RSS
content top

Basic About Programming 3

Monday, August 26th '13
Holla hop!! ^^
I hope you still stay in my blog and contin
the third post for today, i know. what can I do, the senior, called Mr.Handy asked us to do it.
Every theory that we has anyalyze it, "Don't forget to update in your blog", said him.
Walla!! He gave us many assignment, what a kind person, isn't it??

Ok. My last blog talk about Arithmetic Operator, and now we wanna talk about

Increment: ++
Decrement: - -

Increment add 1to its variabel. There are two kind of increment. 
Example:
//Menggunakan angka++

public class Hitung5
{
public static void main (String [] args)
{
int a=10;
System.out.println(a);

System.out.println(++a);
System.out.println(a);
}
}

Menggunakan angka++

public class Hitung5
{
public static void main (String [] args)
{
int a=10;
System.out.println(a);

System.out.println(a++);

System.out.println(a);
}
}


Menggunakan --angka

public class Hitung6
{
public static void main (String [] args)
{
int a=10;
System.out.println(a);

System.out.println(--a);

System.out.println(a);
}
}


//Menggunakan angka--

public class Hitung6
{
public static void main (String [] args)
{
int a=10;
System.out.println(a);

System.out.println(a--);
System.out.println(a);
}


From the picture, I hope you understand what I mean, what the differences,. don't forget to keep trying...
Hidup coding ^^

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 komentar:

Posting Komentar