Skip to content

Commit 3fd0af0

Browse files
authored
Merge pull request #164 from logananglin98/Issue#153Fix
Moved Naming Conventions to chapter 3
2 parents 5cfe592 + 21f03b9 commit 3fd0af0

File tree

2 files changed

+38
-37
lines changed

2 files changed

+38
-37
lines changed

source/ch3_javadatatypes.ptx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,44 @@ public class HistoMap {
798798
Improve the program above to remove the punctuation.
799799
</p>
800800
</section>
801+
802+
<section xml:id="naming-conventions">
803+
<title>Naming Conventions</title>
804+
<p>
805+
It is worth pointing out that Java has some very handy naming conventions. It is advisable to both use meaningful names and to follow these naming conventions while developing software in Java for good maintenance and readability of code.
806+
</p>
807+
808+
<p>
809+
<ul>
810+
<li>
811+
<p>
812+
Class names should be nouns that are written in UpperCamelCase, namely with the first letter of each word capitalized including the first.
813+
For example, <c>ArrayList</c>, <c>Scanner</c>, <c>StringBuilder</c>, <c>System</c>, etc.
814+
</p>
815+
</li>
816+
817+
<li>
818+
<p>
819+
Method names use lowerCamelCase which start with a verb that describes the action they perform. This means that method names start with a lower case letter, and use upper case for each internal-word method names. For example, <c>isInt()</c>, <c>nextLine()</c>, <c>getDenominator()</c>, <c>setNumerator()</c>, etc.
820+
</p>
821+
</li>
822+
823+
<li>
824+
<p>
825+
Instance variables of a class start with a lower case letter and use lowerCamelCase like method names. For example, <c>count</c>, <c>totalAmount</c>, etc.
826+
</p>
827+
</li>
828+
829+
<li>
830+
<p>
831+
Constants are in all upper case letters or in upper snake case, which also known as screaming snake case, and which is a naming convention in which each word is written in uppercase letters, separated by underscores.
832+
For example, <c>Math.MAXINT</c> or <c>MAX_INT</c>.
833+
</p>
834+
</li>
835+
</ul>
836+
</p>
837+
</section>
838+
801839
<section xml:id="chapter3_summary">
802840
<title>Summary &amp; Reading Questions</title>
803841
<p><ol label="1">

source/ch6_definingclasses.ptx

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -430,43 +430,6 @@ public class Fraction {
430430
</code> <tests> </tests>
431431
</program>
432432
</subsection>
433-
434-
<subsection>
435-
<title>Naming Conventions</title>
436-
<p>
437-
It is worth pointing out that Java has some very handy naming conventions. It is advisable to both use meaningful names and to follow these naming conventions while developing software in Java for good maintenance and readability of code.
438-
</p>
439-
440-
<p>
441-
<ul>
442-
<li>
443-
<p>
444-
Class names should be nouns that are written in UpperCamelCase, namely with the first letter of each word capitalized including the first.
445-
For example, <c>ArrayList</c>, <c>Scanner</c>, <c>StringBuilder</c>, <c>System</c>, etc.
446-
</p>
447-
</li>
448-
449-
<li>
450-
<p>
451-
Method names use lowerCamelCase which start with a verb that describes the action they perform. This means that method names start with a lower case letter, and use upper case for each internal-word method names. For example, <c>isInt()</c>, <c>nextLine()</c>, <c>getDenominator()</c>, <c>setNumerator()</c>, etc.
452-
</p>
453-
</li>
454-
455-
<li>
456-
<p>
457-
Instance variables of a class start with a lower case letter and use lowerCamelCase like method names. For example, <c>count</c>, <c>totalAmount</c>, etc.
458-
</p>
459-
</li>
460-
461-
<li>
462-
<p>
463-
Constants are in all upper case letters or in upper snake case, which also known as screaming snake case, and which is a naming convention in which each word is written in uppercase letters, separated by underscores.
464-
For example, <c>Math.MAXINT</c> or <c>MAX_INT</c>.
465-
</p>
466-
</li>
467-
</ul>
468-
</p>
469-
</subsection>
470433
</section>
471434

472435
<section xml:id="inheritance">

0 commit comments

Comments
 (0)