"Belajar Blue-J IDE" Week-2
Berikut merupakan hasil pembelajaran Pemrograman Berbasis Objek Minggu ke-2
Pertama-tama setelah membuat project baru kita perlu menuliskan file "README.TXT"
Berikutnya membuat Class baru dan diisi sesuai kode berikut
Terakhir kita jalankan project tersebut
Pertama-tama setelah membuat project baru kita perlu menuliskan file "README.TXT"
Berikutnya membuat Class baru dan diisi sesuai kode berikut
1:
2: /**
3: * Write a description of class bio here.
4: *
5: * @author Annas Nuril Iman
6: * @version v0.1
7: */
8: public class bio
9: {
10: // instance variables - replace the example below with your own
11: private int x;
12:
13: /**
14: * Constructor for objects of class bio
15: */
16: public bio()
17: {
18: // initialise instance variables
19: x = 0;
20: System.out.println("Nama : Annas Nuril Iman");
21: System.out.println("Kelas : PBO B ");
22: System.out.println("Alamat Rumah : Jl. Simomulyo Baru 7K/16, Sukomanunggal, Surabaya");
23: System.out.println("Email : massive.annas@gmail.com");
24: System.out.println("Blog : https://kedaiambruk.blogspot.com/");
25: System.out.println("No HP/WA : 08953361609011");
26: System.out.println("Twitter : @annasnuriliman");
27: }
28:
29: /**
30: * An example of a method - replace this comment with your own
31: *
32: * @param y a sample parameter for a method
33: * @return the sum of x and y
34: */
35: public int sampleMethod(int y)
36: {
37: // put your code here
38: return x + y;
39: }
40: }
41:
Terakhir kita jalankan project tersebut
Komentar
Posting Komentar