17 Des 2011

New Pen Pal :)

          Yeah, it's nice to make a friend with other citizen. 'Cause basically interest and wanna try some of, i Add some and Follow too. Some of them are nice and welcome and some of them are neither.
          But just now i got my new welcoming Pen Pal which living in New Jersey but born in El Savador :) Yeah at least he's nice to me. But there's maybe something more like funny thing happen in the middle of our journey of friendship. You know, he orders me to tweets more in English so he can actually understand what i said in my tweets, but funniest part is himself is using somewhat like Spanish in almost his tweets not English (ought that's really funny dude) so here someone who getting don't understand what he said is ....  me (forget it). Yeah sometimes i use the service of Google Translate to translate Spanish into English or Indonesian ^^
          Before i ever got some of pen pals from many other countries, and i ever removed one of them too 'cause he chatted me using Arabican Alphabets (and actually i can't read what if without punctuation mark) and when i ordered him to use English as the International Languages, but he refused and he even try to write in Indonesian (it might using Google Translate 'cause almost all the grammar's wrong), that's really bothering you know? So, i'm so sorry i removed you dude :(
          The same funny thing ever happen to me again, i got friend from Quilpue, Chile. He speaks Spanish, and good looking too, hahah. When i wrote in his wall using English, he replied me using Spanish, and so on. You can imagine how difficult communicate with two people using different languages ​​and no one was willing to budge? But i don't know why i still loving this way :)
          I ever share private joke with my mum, i told her what about if i married with the western?, and my mum answered it with laughing ... ZZzzz. Yeah i loved differences, make us can learn and understand each other, perfect! I know i might bad in social with each other, maybe they think i'm not cool or maybe my social syndrome works based on my mood to be socialite, i don't know.
          Okay, the main of this post is i very pleased to have pen pals from abroad, who knows i'll be able to marry one of them someday *i'm joking*. Yeah that's all and have a nice Sunday Afternoon :)





9 Des 2011

Cara Membuat Segitiga Bintang

      Berikut adalah contoh codingnya >>

    public class SegitigaBintang {
    public static void main(String args[])
    {
        int I, N, J, Z, X, kanan, kiri, T; 
       
        N = 8;
        I = 0;
        J = 0;
        X = (N - 1) + N;
        Z = (X / 2);
        kiri = Z;
        kanan = Z;
         
        while (I < N)
        {
            T = kiri;
            while (J < X)
            {
                if(J == kiri || J == kanan)
                {
                    while (T <= kanan)
                    {
                        System.out.print("*");
                        T++;
                    }
                }
                else
                {
                    System.out.print(" ");
                }
                J++;
            }
            kiri--;
            kanan++;
            J = 0;
            System.out.println("");
            I++;
        }
    }
   
    }





     Hasilnya adalah sebagai berikut :







Java PBO

     PBO pada Java merupakan bahasa pemrograman yang berbasis objek. Semua data dan fungsi di dalam PBO dibungkus dalam kelas-kelas atau objek-objek. Berikut adalah istilah-istilah dasar tantang PBO.

1. Inheritance / Pewarisan. Merupakan penurunan semua variable & method dari superClass ke SubClass keyword aksesnya adalah "extends" digunakan untuk relasi 1:1.
2. Polimorfism / Perubahan. Merupakan perubahan bentuk pada method. Ada 2 jenis Polimorfism:
    - Overloard -> perubahan pada parameter di kelas itu sendiri / kelas turunannya. konstruktor & method
        (class sendiri/pewarisan).
    - Override -> perubahan pada body, khusus turunan method (class turunan).
3.  Encaptulation / Pembungkusan. Memiliki 4 tingkat akses,yaitu :
     - Public : dapat diakses oleh semua class pada semua package.
     - Default : dapat diakses oleh semua class tapi hanya dalam 1 package yang sama (1 package).
     - Protection : dapat diakses oleh class turunan & kelas itu sendiri.
     - Private : hanya dapat diakses oleh class itu sendiri.
4.  Modifier. Dibedakan menjadi 2, yaitu :
     - Static : diguakan untuk pemanggilan variable & method agar pengaksesannya tanpa
                   inisialisasi / pembentukan objek.
     - Final : diberikan pada class agar tidak bisa diturunkan, merubah variable menjadi konstan, dan method
                  tidak bisa di override ataupun di overwrite.
5. Abstract Class : merupakan class tertinggi, tidak bisa dibuat objek, berisi abstract method & non abstract
                             method. Keyword untuk mengakses abstract class adalah  "extend" karena berupa class.
      - abstrack method = abstrack yang tidak memiliki body, dan penulisan syntaxnya diakhiri dengan tanda
                             titik-koma (;)
      - non abstrack = memiliki body.
6. Interface. Bukan merupakan class, berisi abstract method (tidak memerlukan definisi "abstract" pada
   penulisan syntax), berisi final variable (variablenya konstan). Untuk mengakses menggunakan keyword
   "implements. Dapat digunakan untuk askses dengan relasi 1 : n.