1

foreheadsobstinacySoftware and s/w Development

Aug 15, 2012 (4 years and 8 months ago)

279 views


Versi 1.2


1

|

P a g e


Modul Praktikum
Mengenali Lingkup Pemrograman Anda


1.

Purpose



Make a Java programme using

text editor

and
console

in
linux (Ubuntu
Dapper)



Difference between
syntax
-
error

and

runtime
-
error



Make a Java programme using
NetBeans


2.

Preface










In this session, we will discuss about how to write,
compile
and r
un Java
programme. There are 2 ways in doing it, first, by using
console

and
text editor.

And how
to do both of them are using Netbeans which is
Integrated Development
Environment

or what we call

IDE
.

IDE
is a tool for programming which have already
integr
ated into the software application which support the GUI build,
text
or coding,
compiler
and
debugger

This tutorial using Ubuntu Dapper as the operating system. Before using this
tutorial, make sure you have installed Java and NetBeans in the system you us
e. For the
instruction on how to install Java and Netbeans, can be seen in
Appendix A
.
for
Windows XP, can be seen in
Appendix B
.

Before going further, in the beginning we will se the first Java programme you will
wrote.

3.

Experiment











Experiment

1
HelloWorld

:

public class Hello

{


/**


* My first java program


*/


public static void main(String[] args) {




//Menampilkan kata "Hello world" dilayar


System.out.println("Hello world!");



}

}


4.

Practice













Versi 1.2


2

|

P a g e


Modul Praktikum
Mengenali Lingkup Pemrograman Anda



4
.
1 Hello World!


Using NetBeans, make a class with name : [YourName]. The result of the programme which
must be printed on screen :


Welcome to Java Programming [
YourName
]!!!



4
.2 The Tree


Using NetBeans, making class with the name :

TheTree.
The result f
rom the program that
should be displayed in screen :


I think that I shall never see,

a poem as lovely as a tree.

A tree whose hungry mouth is pressed

Against the Earth’s sweet flowing breast.