Sponsored links
 
  Search in the Site:

SESSION 5 Part4
Source Files

A project is sort of
like a box.
When you've just made it,
it's empty on the inside.

But you need a place to
actually write the program.

That's what the source file is.

 
I see, you need
something to
write in…




Source File Rules
* Class name and file name must be the same.
* The file name extension is .java
* Make sure to write the file name as
half-width alpha-numeric characters.
* Make sure that the first character of
the file name is upper-case.
 
* Note: most of the above will be done automatically
 for you by the IDE.

   

Got it.
These are the rules that exist for
creating source file.

The extension for
Java source files is '.java'.
This is important, so remember it.

Well, most of these rules
will be done automatically for you
by the IDE.
 



Some of the items automatically created with project creation
Some of the items automatically created with project creation
For now,
it should be enough
if you remember that
class name equals
source file name.


For example, with Java,
it is important that the
file name of the source file
and the class name written
inside it are the same.


But take a look.
They should already be
the same.


The extension is also .java.
The IDE has done this for
you.

 
Umm,
So the file name is
KNMain.java,
and the class name is
KNMain.

You're right. They're
the same.
And the extension is
.java, too.
 


Some of the items automatically created with project creation
Some of the items automatically created with project creation
It's complicated, right?

I'll explain about
the main function next time,
so it's fine if you don't
really understand it now.
Oh, and there's one more thing.

For Java applications,
you always need to have a
'main class (a class with
a Main function)'.


But this already exists as well.
Look, in KNMain.java, a
main function called 'main' is
already there.

Before, you put a check mark
next to "create main class" (*6),
right?

The IDE created it automatically
for you to match the rules
for the minimum requirement
source file.
Normally you'd have to do that
yourself.
 
It's true.
There's a 'main' in there.

When I put a check mark
before,it created a
main class for me,didn't
it?

 



And this time we'll end it here.

The preliminary work takes
quite a bit of time.
Next time we'll finally go into
how to write a program.
Woohoo!

Thank you so much!
I'm looking forward to
next time!

 
 
Look at the flow of program creation.
Please understand the flow of program creation.
We will be studying the details of development from here on,
but your future development will progress smoothly if you understand the overall flow.
Write in half-width alpha-numeric characters.
Development in Java is basically done with half-width alpha-numeric characters.(Aside from comments.)
Please form a habit of using them.

In reality, it is also possible to carry out development in Java using characters other than half-width alpha-numeric characters (languages others than English),
but for now please forget that fact and aim to create things using half-width alpha-numeric characters.
Create a project
By creating and using a project in the IDE,
you can centralize the management of your application development.
You will be able to carry out game development quickly and easily.
Add a source file
The source file is the file in which
you will actually write your program.
Next we will be learning about how to write a program in this file.

The facts we have studied this time will be vaguely OK at this level.
From here on you will gradually come to understand everything, including the main function.

This time we created a file name called KNMain, but what is KN?
Koto herself didn't realize it, but in future we will also explain
about how to chose a file name.
 
Terms for today
Project Source File
Java Application Development Process
 
From next time we will finally go into how to write an actual program.
 
 
home Content previous page next session
[ad]