CENG 161 Introduction to Computer Science + Lab.

farrightΛογισμικό & κατασκευή λογ/κού

15 Αυγ 2012 (πριν από 5 χρόνια και 8 μήνες)

298 εμφανίσεις

CENG 161

Introduction to Computer Science

Instructor: Dr. Nurdan SARAN

Lab Assistant: Arzu Burçak Sönmez


To write your first program, you'll need:

The Java SE Development Kit

For Microsoft Windows, Solaris OS, and Linux:
Java SE Downloads page

The NetBeans IDE

For all platforms:
NetBeans IDE Downloads page

Developing a Java program

Creating a program

A Java program is nothing more than a sequence of
stored in a file with a

You can use any
text editor

for this task, or you can use
one of the more sophisticated program development


Developing a Java program

Compiling a program

s are

designed to be best

by the


The computer’s language is far more

primitive than

compiler is an application that translates a
program from the

Java language to a language more
suitable for executing on the computer.

The compiler

takes a file with a
extension as
input (your program) and produces a

file with the
same name but with a
extension (the
language version)

Developing a Java program

Executing a program

Once you compile the program, you can run it

Your computer follows your instructions

A part of
the Java system known as the
Java Virtual
Machine (the JVM) directs your

computer to follow
your instructions

Create an IDE Project

Launch the NetBeans IDE.

On Microsoft Windows systems, you can use the
NetBeans IDE item in the Start menu

In the NetBeans IDE, choose File


Create an IDE Project

In the New Project wizard, expand the Java category and
select Java Application as shown in the following figure:

Create an IDE Project

In the Name and Location page of the wizard, do the following
(as shown in the figure below):

Create an IDE Project

The project is created and opened in the IDE.

Your First Program

This is a simple Java code

Write the code and run it
in order to see what

The showMessageDialog Method