Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoikLectures
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Goik Martin
GoikLectures
Commits
0acdc87c
Commit
0acdc87c
authored
9 years ago
by
Goik Martin
Browse files
Options
Downloads
Patches
Plain Diff
Typo
parent
834514e3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Doc/Sd1/languageFundamentals.xml
+6
-6
6 additions, 6 deletions
Doc/Sd1/languageFundamentals.xml
with
6 additions
and
6 deletions
Doc/Sd1/languageFundamentals.xml
+
6
−
6
View file @
0acdc87c
...
@@ -1104,9 +1104,9 @@ System.out.println("New value=" + a);</programlisting>
...
@@ -1104,9 +1104,9 @@ System.out.println("New value=" + a);</programlisting>
System.out.println(area);
System.out.println(area);
}
</programlisting>
}
</programlisting>
<para>
Though there is nothing wrong with this approach
but it ma
y
<para>
Though there is nothing wrong with this approach
it actuall
y
be considered
error prone
.
A careless programmer may accidentally
is
error prone
:
A careless programmer may accidentally
redefine
redefine
the value of
<code>
pi
</code>
:
</para>
the value of
<code>
pi
</code>
:
</para>
<programlisting
language=
"noneJava"
>
public static void main(String[] args) {
<programlisting
language=
"noneJava"
>
public static void main(String[] args) {
...
@@ -1167,9 +1167,9 @@ System.out.println("New value=" + a);</programlisting>
...
@@ -1167,9 +1167,9 @@ System.out.println("New value=" + a);</programlisting>
definition of our variable
<code>
area
</code>
to avoid erroneous
definition of our variable
<code>
area
</code>
to avoid erroneous
redefinitions as well.
</para>
redefinitions as well.
</para>
<para>
As a rule of thumb: Whenever you
expect
a variable not to
<para>
As a rule of thumb: Whenever you
intend
a variable not to
change after initial assignment use
<code>
final
</code>
to declare
change after
an
initial assignment use
<code>
final
</code>
it as be
in
g
constant.
</para>
declaring it to rema
in constant.
</para>
</answer>
</answer>
</qandaentry>
</qandaentry>
</qandadiv>
</qandadiv>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment