Skip to content

Commit 83d25de

Browse files
committed
Fixes minor issues on comments
1 parent 6d17f54 commit 83d25de

File tree

3 files changed

+56
-25
lines changed

3 files changed

+56
-25
lines changed

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Java template
3+
# Compiled class file
4+
*.class
5+
6+
# Log file
7+
*.log
8+
9+
# BlueJ files
10+
*.ctxt
11+
12+
# Mobile Tools for Java (J2ME)
13+
.mtj.tmp/
14+
15+
# Package Files #
16+
*.jar
17+
*.war
18+
*.ear
19+
*.zip
20+
*.tar.gz
21+
*.rar
22+
23+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
24+
hs_err_pid*
25+
26+
.idea/inspectionProfiles/

src/JF01_TheBasics.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// The Basics - Comments, classes, and entry points
1+
// Java Fundamentals 01 - The Basics - Comments, classes, and entry points
22

3-
// This is a comment line. Everything after the // is ignored by the Java compiler (until the end of the line).
3+
// This is a comment line. Everything after the // is ignored by the Java compiler (up to the end of the line).
44

55
/*
66
This is a comment block. Everything between "whack asterisk" and "asterisk whack"is ignored...
@@ -18,7 +18,7 @@
1818
// as the class plus the extension ".java".
1919
public class JF01_TheBasics {
2020

21-
// This a program entry point. If a method (function of a class) has this exact signature:
21+
// This a program entry point. If a method (function inside a class) has this exact signature:
2222
// public static void main(String[] args)
2323
// it can be where your program starts running, the entry point.
2424
public static void main(String[] args) {
@@ -33,13 +33,12 @@ public static void main(String[] args) {
3333
/*
3434
To compile and run this program:
3535
1. Download and install the Java JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html
36-
recommendation: start out with the latest Java 8 JDK (Java 1.8)
37-
2. From the command line, on the directory where this file is, execute the command: javac "JF01_TheBasics.java
36+
recommendation: start out with the latest Java 8 or 9 JDK (Java 1.8 or 1.9)
37+
2. From the command line, on the folder where this file is, execute the command: "javac JF01_TheBasics.java"
3838
Obs.: if you list the contents of the folder you should see the file JF01_TheBasics.class (the compiled class)
39-
3. From the command line, execute the command "java JF01_TheBasics""
39+
3. From the command line, on that same folder, execute the command "java JF01_TheBasics""
4040
Result: you should see the string "Hello Java Fundamentals!" on the screen.
4141
*/
4242
}
4343

44-
// Next Source code: JF02_Packages.java
45-
// This file will be under com/fledger/javafundamentals
44+
// Next Source code: src/com/fledger/javafundamentals/JF02_Packages.java -> https://goo.gl/DnMZgs
Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
1-
// Packages determine the folder structure of your projects.
1+
// Java Fundamentals 02 - Packages
2+
3+
// Packages determine the folder structure of your projects. By convention they are all lowercase.
24
// They are used to organize your source code and create scope to avoid name collisions.
35
// If you use a package, it should be the first statement of your source file.
4-
// To keep names unique, package names usually start with the domain name inverted
5-
// ex.: fledger.com -> com.fledger
6-
// after the domain name you determine the package hierarchy to organize your code
6+
// To keep names unique, package names usually start with the web domain name inverted
7+
// ex.: fledger.com -> "com.fledger"
8+
// following the inverted domain name, you name package hierarchy to organize your code
79
// The folder structure should reflect the package structure, from the root of source code.
8-
// ex.: com.fledger.javafundamentals => src/com/fledger/javafundamentals (if src is the root of source code)
10+
// ex.: "com.fledger.javafundamentals" -> src/com/fledger/javafundamentals (if src is the root of source code)
911
package com.fledger.javafundamentals;
1012

1113
// Imports let you use code from other classes or packages
1214

13-
// The following statement lets you use the class Date from the package java.util:
15+
// The following statement lets you use the class Date from the package "java.util":
1416
import java.util.Date;
1517

16-
// The following statement lets you use any class from the java.text package (including DateFormat):
18+
// The following statement lets you use any class from the "java.text" package (including "DateFormat"):
1719
import java.text.*;
1820

19-
// The fully qualified name of this class is com.fledger.javafundamentals.JF02_Packages
21+
// The fully qualified name of this class is "com.fledger.javafundamentals.JF02_Packages"
2022
public class JF02_Packages {
2123

2224
// You already know what an entry point is:
2325
public static void main(String[] args) {
24-
// Creates an object now from the class Date (contains date and time). It is initialized to the current time.
26+
// This creates an object called "now" from the class "Date" (that contains date and time).
27+
// It is initialized to the current time.
2528
Date now = new Date();
26-
// Creates an object to format a Date with the long time format.
29+
// This creates an object to format a "Date" with the long time format.
2730
DateFormat dateFormat = DateFormat.getTimeInstance(DateFormat.LONG);
28-
// Writes the current time using the long time format.
31+
// This writes the current time using the long time format.
2932
System.out.println("Now it is " + dateFormat.format(now));
3033
}
3134

3235
/*
3336
To compile and run this program:
3437
1. From the command line, on the source root folder, execute the command:
3538
javac com/fledger/javafundamentals/JF02_Packages.java
36-
Obs.: it will create JF02_Packages.class in that folder (javafundamentals)
37-
2. From the command line, execute the command
39+
Obs.: it will create a "JF02_Packages.class" file in that folder (javafundamentals)
40+
2. From the command line, execute the command (still from the source folder)
3841
java com.fledger.javafundamentals.JF02_Packages
39-
Notice that you compile (javac) a file (with .java extension)
40-
and run (java) a class (with fully qualified name)
41-
Result: you should see "Now it is " and the current time, long format, on the screen.
42-
By the way, it is about time for you to use an IDE. I recommend Eclipse or IntelliJ Idea Community!
42+
Notice that you compile (javac) a file (with .java extension),
43+
and you run (java) a class (using its fully qualified name)
44+
Result: you should see "Now it is " followed by the current time on the screen.
45+
By the way, it is about time for you to use an IDE. I recommend Eclipse or IntelliJ Idea CE, both free!
4346
*/
4447
}
48+
49+
// previous file: src/JF01_TheBasics.java -> https://goo.gl/rJN5Aj
50+
// next file: src/com/fledger/javafundamentals/JF03_xxx.java ->

0 commit comments

Comments
 (0)