Tips2 Komputer

Mungkin Ini Yang Anda Cari ?

Related Artikel :

Minggu

Tutorial Dasar2 Java

Java Fundamental Bagi temen2 yg baru sekali ini belajar Java.. Ini ada tutorial singkat mengenai cara membuat file Java, mengcompile file Java tersebut, dan bagaimana menjalankan program Java. Dibagian ini juga akan membahas sedikit tentang variabel dalam Java.. Silahkan mengikuti Smile Okey skrg gw kasih tutorial singkat mengenai Java, bukan tutorial game, melainkan tutorial dasar-dasar Java, untuk membantu yang bener2 pemula sama sekali ^_^ LANGKAH 1: Membuat kode program Java Nah hal pertama adalah, bagaimana asal mula suatu program aplikasi Java? Untuk menjalankan program Java, pertama-tama kita buat file teks (txt) biasa, beri nama dengan format penamaan TitleCase dan akhiri dengan extension .java : Misalnya Test.java class="fullpost"> Untuk mengisi kode programnya, edit file tersebut dengan menggunakan teks editor apa saja, misalnya Notepad. FILE :: Test.java Isikan kode programnya:
Code:
public class Test { // Test -> sesuai dengan nama filenya: Test.java // (ingat Java case sensitive, Test berbeda dgn test) }

PS: "//" adalah komentar, apapun yang ditulis setelah // tidak akan diproses PS2: sekali lagi Java adalah case sensitive, penulisan harus benar2 memperhatikan huruf kecil dan huruf besar. LANGKAH 2: Mengcompile kode program kita Compile kode program yang telah kita buat dengan menggunakan Java compiler (javac.exe) yang telah termasuk dalam bundel Java SDK (J2SE), dapatkan Java SDK di http://java.sun.com/j2se/. Gunakan DOS Prompt, buka melalui Start menu-Run-ketik CMD. Tuliskan ini di DOS prompt :

Code:
javac Test.java

Setelah dicompile Test.java akan menghasilkan Test.class

Quote:
Test.java (kode program) compile -> Test.class (java bytecode)

LANGKAH 3: Menjalankan program tersebut Untuk menjalankan program yang telah kita compile diatas digunakan Java launcher (java.exe), juga melalui DOS prompt :

Code:
java Test

Pada tahap ini program kita diatas akan mengeluarkan error tidak dapat dijalankan, karena Java tidak tahu harus dimulai darimana program aplikasi kita ini. LANGKAH 4: Membuat start awal aplikasi Start awal jalannya suatu aplikasi Java dimulai dari ditemukannya kata kunci (keyword) :

Code:
public static void main(String[] args) { }

Nah tinggal tambahkan keyword tersebut ke file Test.java kita :

Code:
public class Test { public static void main(String[] args) { // application start-point } }

Jadi program Test.java diatas sudah dapat dicompile DAN dijalankan. Tapi karena isinya kosong, jadi program kita tsb tidak melakukan suatu hal apapun, sungguh suatu program yang tak berguna Smile java Test -> masuk ke bagian application start-point dan selesai, tidak ada yang dikerjakan. LANGKAH 5: Mengeluarkan suatu tulisan Nah untuk mengeluarkan output ke console (DOS prompt) kita gunakan fungsi System.out.println("kata") :

Code:
public class Test { public static void main(String[] args) { System.out.println("Hello World!"); } }

Program kita diatas ketika dijalankan akan mengeluarkan tulisan Hello World ke console. Ah ha! Akhirnya program kita sudah jalan dan mengerjakan sesuatu, apakah Anda sudah cukup senang sekarang?! Smile Nah selanjutnya kita akan mengenal variabel2 dalam bahasa program Java. LANGKAH 6: Mengenal variabel serta jenis-jenisnya Nah setelah kita mengetahui bagaimana dasar aplikasi Java dari membuat file berekstensi .java sampai menjalankannya, sekarang saatnya untuk berkenalan dengan jenis-jenis variabel yang terdapat dalam Java. Jadi apa itu variabel?? Untuk menyimpan nilai tertentu di dalam program aplikasi kita (memori komputer), nilai tersebut haruslah disimpan sesuai kedalam suatu variabel yang tipenya sesuai dengan tipe dari nilai tersebut. Kita tidak dapat menyimpan tipe bernilai angka ke variabel bertipe nilai huruf ataupun sebaliknya. Pada bahasa pemograman Java, tipe-tipe variabel yang tersedia diantaranya :

Quote:
- int : untuk menyimpan nilai berupa angka bilangan bulat, misalnya: 10 - double : untuk menyimpan nilai berupa angka bilangan desimal, misalnya: 0.5 - String : untuk menyimpan nilai berupa teks kata-kata, misalnya: "Hello World" - boolean : untuk menyimpan nilai sederhana iya atau tidak, misalnya: true

Untuk mendeklarasikan variabel yang dapat menyimpan nilai tersebut cukup dengan menggunakan:

Code:
[tipe_variabel] [nama_variabel];

misalnya: int tipeInt; pendeklarasian variabel bernama tipeInt sebagai variabel bertipe int Untuk mengisikan nilai ke variabel tsb gunakan tanda =

Code:
int tipeInt; tipeInt = 10; // mengisi tipeInt dengan nilai 10

Contoh dalam program:

Code:
public class Test { public static void main(String[] args) { int a = 10; double b = 0.5; String c = "Halo"; boolean d = true; // mengeluarkan nilai diatas ke console System.out.println(a); // console tertulis: 10 System.out.println(b); // console tertulis: 0.5 System.out.println(c); // console tertulis: Halo System.out.println(d); // console tertulis: true // ganti nilai variabel a a = 100; System.out.println(a); // console tertulis: 100 } }

Setelah kita mengetahui jenis-jenis tipe variabel dan bagaimana menggunakannya, sekarang kita lihat bagaimana cara mengolahnya/memanipulasinya. LANGKAH 7: Operasi variabel Variabel tersebut dapat kita olah sama seperti didalam matematika, yakni dengan menggunakan operasi pertambahan (+), pengurangan (-), perkalian (*), pembagian (/), ataupun hasil bagi (%). Misalnya: int a = 10 + 10; // pertambahan Tidak ada yang spesial dalam mengolah data variabel tersebut, cukup gunakan tanda +, -, *, /, % Contoh:

Code:
public class Test { public static void main(String[] args) { int a = 10; int b = 20; int c = a + b; // 10 + 20 = 30 int d = a - b; // 10 - 20 = -10 System.out.println(a); System.out.println(b); System.out.println(c); System.out.println(d); double e = 2; double f = 4; double g = e * f; // 2 x 4 = 8 double h = e / f; // 2 / 4 = 0.5 System.out.println(e); System.out.println(f); System.out.println(g); System.out.println(h); System.out.println(5 % 3); // = 2 -> 5 / 3 = 1 sisa 2 } }

Java juga menyediakan cara untuk mempersingkat operasi tertentu:

Code:
int a = 0; // menambah dengan 10 cara 1: a = a + 10; cara 2: a += 10; // lebih singkat

Sama halnya dengan pengurangan, perkalian, pembagian.

Code:
a -= 10; a *= 10; a /= 10;

Dan Java juga menyediakan khusus penyingkatan untuk penambahan/pengurangan dengan 1:

Code:
a = a + 1; -> a += 1; -> a++; a = a - 1; -> a -= 1; -> a--;

Begitulah ulasan singkat dari Paupau si pembuat tutorial ini, semoga temen2 bisa mendapatkan dasar untuk belajar Java, selanjutnya mungkin akan banyak lagi ulasan2 menarik ttg Java..tunggu saja update terbarunya di post ini, atau apabila temen2 merasa tidak punya waktu untuk menunggu..temen2 bisa membaca tutorial java di : http://java.sun.com/docs/books/tutorial/

Data Recovery Tools For Hard Disk Failur

From a user viewpoint, the computer is only as good as the data it contains. If the computer can't boot up, it's practically useless. If it can boot up but the files are corrupted and cannot be opened for reading or writing, the file is useless. This happens often enough that data backup and recovery tools are a must with computer users. In fact, it's a good idea to have two copies of important data, just in case the first backup fails. Data recovery tools make sure that the backup is restored and the user can go back to using the computer in as little a downtime as possible.

You might say that the root cause of data corruption is the hard disk. And of all the various parts of a computer, the hard disk is most prone to failure. There are only so many moving parts to a computer. These are usually either fans or the disk drives. And a hard disk spins much faster than a cooling fan. A slowest hard disk spins at 5,400 RPM, and some expensive high performance hard disks spin almost three times faster at 15,000 RPM.

Aside from the processor, the hard disk generates a large amount of heat. The faster it spins, the hotter the disk. Although the expected life span of a hard disk is five years, with the continuous spinning and the generated heat, disks start to fail after three years of use. Within the first three years of use, hard disk failure in one form or another is expected to occur.

Data corruption can occur due to any of a number of reasons. An electrical outage or a spike can cause data corruption. An improper shut down can also cause data corruption. In most instances the data corruption might not go unnoticed. Unless the file is hit and the computer does not work properly, only then will the problem show itself.

Worst case would be when the hard disk's master boot record (MBR) is corrupted or a boot sector develops a bad sector. In which case the computer would not be able to boot up and the user is forced to do a data recovery as well as a hard disk recovery.

Any hard disk recovery effort would also be useless if it does not recover the latest data. Part of any data recovery tool kit would be a backup program and procedure. For data backup, the simplest tool is a file copy on a separate disk. This is especially useful for important files. Recovering from corrupted files on the computer is as easy as copying from the remote computer or hard disk.

It would be better however to have a data backup or a data recovery software. A data recovery software can schedule file backups to a tape backup device or a another drive. Windows has a backup software included called Backup.

Data recovery for corrupted files or folders should not be a problem if the data backup is up-to-date. Windows Backup also has the facility to restore data from backed up files.

When the computer fails to boot up, it might be because the master boot record or the operating system is corrupted, or the partition might be lost. For lost partitions or lost boot records, a simple file backup will not suffice. The computer has to boot up first before it can start any file backup.

Some data recovery tools have the facility to recover hard disk partition information. As with regular file backup, the recovery tool needs a backup. To recover a hard disk, either a hard disk as a whole is backed up (called a mirror) or just the partition. Commercial data recovery packages such as DriveClone and Ghost can backup a partition or a hard drive and recreate it to repair the failed hard drive, or to write it to another hard disk or computer altogether. These programs can boot from a recovery CD and proceed to do a hard disk and data recovery.

For larger installations, there are data recovery software from vendors like Acronis and Veritas which can backup multi-volume disks and RAIDs using disk backups and tape drives.

Hard disk failure and data corruption is a serious concern. In cases like these when the computer fails to boot up, or the data could not be read, it helps a lot if data recovery tools are ready, in use and allows easy recovery of data.

To learn even more about data recovery visit LearnDataRecovery.com where you will find more information about data recovery tools.

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Hot Sonakshi Sinha, Car Price in India