Search

Loading...

Pages

Labels

Followers

Chat

Powered by Blogger.
Monday, November 22, 2010
In Java, we can use array in for statement without counter. We use parameter in for statement as a variable to achieve each array value at looping process. The syntax of this enhanced for statement is:

for ( parameter : arrayName)
      statement

Lets see in an example:


public class Main {
    public static void main(String[] args) {
        int array[] = {1, 3, 4, 4, 5};
        int total=0, total2 = 0;
        for(int number : array)
            total += number;
        System.out.println("Total : " + total);
        for(int number2 = 0; number2<array.length; number2++)
            total2 += array[number2];
        System.out.println("Total2 : " + total2);
    }
}


Run the code, and the result seems like this:



Look, the value of Total is equals to Total2. As we know, variable Total has its value from looping (for) statement, while Total2 has a value from using counter in looping statement.

Hope it could be useful information :D
Friday, November 19, 2010
Netbeans is the popular free IDE (Integrated Development Environment) that support many programming language. Netbeans provide a lot of feature for Java programmer, especially in GUI application development. It has large support to build object oriented application.
This article shows you how to build simple GUI application with event handling in the button inside. Building Java GUI application in Netbeans is fun.... :D
Download the article here
Wednesday, November 3, 2010
Is your inbox full of email from facebook? If so, then you must limit them or even banish them. :D
It's true that the notification email from facebook is useful to notify us about recent activity in our facebook. But, it will be annoying if there is so much of notification in our email, so that the more meaningful email may be marginalized by those email from facebook. To limit notification email from facebook, do these steps:
When our computer is begin to running slow, it must be irritating. Sometimes it caused by ourselves that forget to clean up the junk files in the recycle bin. But when cleaning up the recycle bin is not enough, these some steps must be useful:
There are two ways to set visible/offline in Facebook. First famous method is through Options &gt; Go Offline. These trick is just set our status to offline with change the icon color to gray. Thus, our friends are still enable to know that we are active (login) or not in facebook. Honestly, there is second simple trick to hide our status from our friend, even our login is not realized by our friend.
There are many ways to find out our ideal weight. One of the most simple method is using this formula:
> for men
Ideal weight = height - 105
> for women
Ideal weight = height - 115
As example if a man with height 170 cm, his ideal weight is 170 - 105 = 65 kg. While for the women, her ideal weight is 170 - 115 = 55 kg.
I ever tried to make simple application for this case in Java, it is the weekly task in Java Programming subject at Second Semester of my study.
The script and example can be download here.