Pages

Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Tuesday, December 1, 2009

Effective Java


Introduction

THIS book is designed to help you make the most effective use of the Java™ programming language and its fundamental libraries, java.lang, java.util, and, to a lesser extent, java.util.concurrent and java.io. The book discusses other libraries from time to time, but it does not cover graphical user interface programming, enterprise APIs, or mobile devices.
This book consists of seventy-eight items, each of which conveys one rule. The rules capture practices generally held to be beneficial by the best and most experienced programmers. The items are loosely grouped into ten chapters, each
concerning one broad aspect of software design. The book is not intended to be
read from cover to cover: each item stands on its own, more or less. The items are heavily cross-referenced so you can easily plot your own course through the book.

Sunday, November 29, 2009

Catatan UTS Pemrograman 3

Tulisan ini saya khususkan buat teman-teman peminatan PSI semester 7, tetapi tidak tertutup kemungkinan buat teman-teman dan pembaca lainnya. Berikut merupakan catatan yang dapat digunakan untuk membantu teman-teman dalam ujian Pemrograman 3 besok (moga2.. he....), file ini berlisensi GPL jadi silahkan ubah sesuai dengan kebutuhan, jika terdapat penambahan sekiranya catatan ini kurang lengkap tolong beri tahukan kepada saya sehingga saya dapat memperbaikinya lagi.

Silahkan download : NoteUTSP3
Revisi download     : NoteUTSP3-Revisi

Sedikit pembahasan tentang cara menerima inputan teks dari keyboard :
Hal yang perlu dilakukan untuk pertama yaitu melakukan import library yang diperlukan :

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

import diletakan sebelum Public Class, agar tidak perlu meng-import satu-persatu, maka dapat dengan cara :

import java.io.*

Kemudian untuk menggunakannya kita harus memanfaatkan BufferedReader, seperti di bawah ini :

BufferedReader readIn = new BufferedReader(new InputStreamReader (System.in))

readIn merupakan sebuah variabel yang dibuat menerima input dari keyboard

Untuk Coding lengkapnya seperti di bawah ini :

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
    public static void main(String[] args) {
        String name;
        name = "";
        BufferedReader readIn = new BufferedReader(new InputStreamReader (System.in));
        System.out.print("Input your name ");
        try
        {
            name = readIn.readLine();
        }
        catch(IOException e)
        {
            System.out.println("Error");
        }
        System.out.println("Hello " + name);
    }
}

Ingat!!! Jika masih kurang dan ada penambahan tolong beri tahu saya...

NB : Moga dapat membantu sedikit...(walau tidak banyak)