|
SESSION 5 Part2 |
Before you start programming |
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
Woohoo! Preparations
complete!
With this I can start
studying programming,
right! |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
 |
Don't worry,
don't worry!
I downloaded
Javadoc
all over again. |
|
Is she really
okay? |
 |
|
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
Oh, that's right…
First of all, let's talk
about
the objective of
our future sessions.
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
To give you advance warning, what
we're studying from here on is
"the basics of the basics of programming".
The details are the same for most languages.
These concepts are not limited to
the Java language, and can
also
carry over into other languages. In particular,
C and C++ type
languages.
As much as possible, I want you to think of
this as "knowledge I
can use".
This is because it is useful for various uses,
not just games.
Think of the contents of these sessions
as applying to
all software development.
We won't really be using any features
other than
basic Java features and
basic development environment features.
So try and grasp these basics. |
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
To put it another way,
you don't have to worry
about things like
the version of Java, etc.
This is because
the basic details
will be the same
no matter what version. |
 |
|
 |
Okay! |
|
|
|
 |
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
And, I want you to form a habit of
searching the internet for things
you don't understand.
Right now is a good era for
studying.
Until quite recently, you had to buy
lots of books to research things,
but this information is now
steadily being added to the internet.
It would be a waste not to utilize this.
If you have questions, first do a search!
Whatever you do, don't become the sort
of person
who expects to have
everything explained to them. |
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
Understood!
I'll take notes on
everything so
that
it doesn't
matter if I forget. |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
 |
|
|
|
The flow of program creation (development process) |
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
Your development environment
is ready,
so first of all,
let's look at
the flow of
program creation.
For now, have a brief look
and try and get a feel for it.
|
|
|
 |
 |
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
 |
 |
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
Okay!
Wow, I see.
You make them like this,
huh… |
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
For now I think it's fine to divide it up like this.
What we'll be studying next is the development part.
You'll complete your program by repeatedly
writing code, testing and debugging.
This flow of planning and developing a program
is called a "development process", but
various research is being done so that people can
develop more
efficiently.
I won't write about these here, but
there's development processes, development methods,
development
models…
there's so many methods and types that there's no end
of things
to study.
There's also many books available, so even this itself is
a
complex topic.
If you're interested, try studying it a little at a time. |
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
Upstream processing and downstream
processing…
Prototyping,
agile development…
There's just too many,
even I don't really understand. |
 |
|
 |
Hoho,
even NAPO-chan
doesn't understand!
|
|
|
|
|
|
The common rules of Java programming |
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
Next I will tell you the
common rules when
starting out with
programming. |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
 |
 |
|
|
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
First is the way you write characters.
In Java,
full-width characters, half-width characters,
upper-case characters and lower-case characters
are all perceived as different types of characters.
In programming, there are successive characters, or
in other
words character strings made up of words
and characters,
and
"file" and "file"
(half-width and full-width characters)
are perceived as being different character strings.
"file" and "File"
(first character upper-case)
are also
different things.
If it's wrong it won't run properly, so you need to be
careful.
Also be careful of the file name. |
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
You understand
half-width and
full-width
characters, right…
|
 |
|
 |
Of course! |
|
|
|
|
About full-width (double-byte
characters)
and
half-width(single-byte
characters) |
|
People
from the English-speaking world
probablyaren't really aware of these.
There are languages other than
English thatprimarily use double-byte
characters,so they are very important.
These days, double-byte
characters such as Unicode are becoming
more
common. |
|
|
Oh, good.
So at least this
should be okay
for you? |
 |
|
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
Also,
for coding in Java we mainly
use
half-width alpha-numeric
characters.
Half-width characters are basically
used for
everything other than the
parts where comments are written.
When you want to enter a
blank space,
use a half-width
space or the 'Tab' character.
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
Okay.
Half-width characters,
right! |
|
|
 |
 |
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
 |
|
|
 |
|
 |
|
|
Rules for Java Coding |
|
|
* |
Full-width characters, half-width characters,
lower-case characters and upper-case characters
are
perceived as different characters.
|
* |
Half-width alpha-numeric characters are mainly used. |
|
|
|
|
|
 |
|
 |
|
|
 |
|
 |
|
|
Rules for File Names |
|
|
* |
Make sure to write them in half-width alpha-numeric
characters. |
* |
They cannot start with a number. |
* |
The only symbols that can be used are '_' (underscore)
and
'$' (dollar sign). |
|
|
|
|
|
 |
|
 |
|
Huh? |
 |
|

|
So in the end,
half-width characters
are just right for
computers? |
|
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
And you should also be careful of how you
assign a file name.
Make sure to meet the conditions on the board.
This isn't just limited to file names.
When assigning Java
names,
in most cases they can't start with numbers,
and the only symbols that can be used are
the '_' (underscore) and '$' (dollar sign).
When deciding what name to assign it,
basically make sure you only use
half-width alpha-numeric
characters. |
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
That
full-width and
half-width thing,
it's like, how square
the width makes the
characters, right!
|
|
|
 |
 |
|
 |
 |
|
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|
|
|
|
|
|
|
 |
In the end,
computers
don't understand
soft, rounded
characters, do they?
But then, full-width
characters are
too square for them! |
|
Just as I
thought…
I'm telling you,
it's about the
size of
the
characters… |
 |
|
|
* Please note: this is
a Japanese language joke, so some nuance is lost. Sorry!
|
|
|
|
|
|
|
|