Professional Documents
Culture Documents
AN OBJECT-ORIENTED BOOK
d1at shO\VS you ho,v to use business classes,
inheritance, and interfaces d1e \vay they're
used in the real world
Expanded contents
Section 1 Essentia l skills
Chapter 1 An introduction to Java
An overview of Java ............................................................................ 4
Java timeline .................................................................................................................... 4
Java editions .................................................................................................................... 4
How Java compares to C++ and C# ................................................................................ 6
Types of Java applications ................................................................ 8
Two types of desktop applications .................................................................................. 8
Web applications and mobile apps ................................................................................ IO
An introduction to Java development............................................. 12
The code for a console appl ication .. .............................................................................. 12
How Java compiles and interprets code ........................................................................ 14
An introduction to Java IDEs ........................................................................................ 16
How to use NetBeans to work with existing projects ................... 18
An introduction to NetBeans ......................................................................................... 18
How to open, close, and delete a project.. ..................................................................... 20
How to compile and run a project ................................................................................. 20
How to use the Output window with a console application .......................................... 22
How to work w ith two or more projects........................................................................ 24
How to use NetBeans to develop new projects ............................. 26
How to create a new project .......................................................................................... 26
How to work with Java source code and ti les ............................................................... 28
How to use the code completion feature ....................................................................... 30
How to detect and correct syntax errors ........................................................................ 32
Companion books
When you finish this book, you'll have all of the Java skills that you need
for moving on to web or mobile programn1ing with Java. Then, if you \Vant to
move on to web progranuning, Murach's Java Servlets and ISP will show you
ho\v to use Java servlets and Java Server Pages to develop professional web
applications. Or, if you want to move on to Android programming, Murach's
Android Prograrnming will get you started with that.
XX lntroduc1io11
~~l ~Author
~'J3odnc
Anne Boehm
Editor
Section 1
Essential skills
This section gets you started quickly with Java programming. First, chapter
1 introduces you to Java applications and shows you how to use an IDE
to \VOrk \vith Java projects. Then, chapter 2 shows you how to write your
first Java applications. When you complete these chapters, you' ll be able to
write, test, and debug simple applications of your O\vn.
After that, chapter 3 presents the details for working with the eight
primitive data types. Chapter 4 presents the details for coding control
staten1ents. Chapter 5 shows how to code n1ethods, handle exceptions, and
validate data. And chapter 6 shows ho\v to thoroughly test and debug an
application. In addi6on, it shows how to deploy an application.
These are the essential skills that you'll use in almost every Java
application that you develop. When you finish these chapters, you' ll be able
to write solid programs of your own. And you'll have the background that
you need for learning how to develop object-oriented progran1s.
1
An introduction to Java
This chapter starts by presenting some background inforn1ation about Java.
This information isn't essential to developing Java applications, so you
can skin1 it if you \Vant. However, it does show how Java works and how it
con1pares to other languages.
After the background information, this chapter shows how to use the
NetBeans IDE (Integrated Development Environn1ent) to work with a Java
application. For this book, we recon1mend using NetBeans because \Ve think
it's the best and most intuitive IDE for getting started with Java.
However, Eclipse is another great IDE for working \vith Java
applications, and many progra111mers prefer it. As a result, the download for
this book includes a PDF file that shows how to use Eclipse \vith this book
instead of NetBeans. So, if you want to use Eclipse, you can use this PDF file
whenever you need to learn how to perfor111 a task with Eclipse.
Language: Finnish
Kaksi novellia
Kirj.
ALEKSANTERI PETÖFI
Suomentanut
Meri Sulju
SISÄLTÖ:
I. Aleksanteri Petöfi.
II. Papurikko ja valakka.
III. Ukkovaari.
Aleksanteri Petöfi.
Papurikko ja valakka.
Voi merkittyä!
Ja vastarinta alkoi…
"Hiljaa!"
"Rakas mies", jatkoi vaimo, "kun minä vihdoin puhun, niin tahdon
keventää sydämeni kaikesta siitä, mikä sitä rasittaa. Olen vaiennut
kyllin kauvan."
"Vaikene!"
"Vaieta? Miksi?"
"Kiitos kaunis!"
"Vaimo! Tiedät, että saan sinua käskeä, koska olen sinun herrasi.
Mutta minä en käske, minä pyydän: Anna minulle puku! Pyydän
sinulta, rakas, hyvä Sofie."
"En!"
"En, en!"
"Turhaan!"
Viini virtaili kuin olisi hän saanut sen ilmaiseksi. Herra Daniel
päätti, ettei hän ennen nouse pöydästä, ennenkuin on juonut koko
morsiusleningin hinnan suuhunsa.
Vartija laahasi ruumiin asuntoon, missä vaimo oli tunti sitte antanut
elämän lapselle.
Pimeässä tuvassa oli nyt kolme: kuollut isä, pikku poika, jonka
elämä oli juuri alkanut ja äiti, joka horjui elämän ja kuoleman välillä…
Leski hautautti miehensä ja kastatti lapsen. Hänet nimitettiin
Martiksi. Tästä menevä maksu papille oli aivan hyödytön menoerä,
sillä elämän keväässä eivät toiset lapset kuitenkaan nimittäneet
poikaa muuksi kuin "punaiseksi koiraksi", ja myöhemmin, kun hän
vanheni, tunnettiin hänet vain nimeltä "Papurikko". — Jokainen
lyönti, jonka hänen äitinsä ennen pojan syntymistä oli tämän isältä
saanut, oli merkittyinä hänen kasvoihinsa, joiden oikea puoli oli
hehkuvalla punalla peitetty.
*****