Skip to content

Commit ef0a8ec

Browse files
committed
add example of shadowing in java
1 parent 33aaa43 commit ef0a8ec

File tree

8 files changed

+41
-22
lines changed

8 files changed

+41
-22
lines changed

assets/js/lunrsearchengine.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

feed.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<description>Collection of curated articles with in depth analysis on a topic to present a different perspective with interactive illustrations</description>
1414
<link>https://solothought.com/</link>
1515
<atom:link href="https://solothought.com/feed.xml" rel="self" type="application/rss+xml"/>
16-
<pubDate>Sun, 26 Nov 2023 02:18:59 +0000</pubDate>
17-
<lastBuildDate>Sun, 26 Nov 2023 02:18:59 +0000</lastBuildDate>
16+
<pubDate>Sun, 26 Nov 2023 06:58:44 +0000</pubDate>
17+
<lastBuildDate>Sun, 26 Nov 2023 06:58:44 +0000</lastBuildDate>
1818
<language>en-US</language>
1919
<sy:updatePeriod> daily </sy:updatePeriod>
2020
<sy:updateFrequency> 1 </sy:updateFrequency>
@@ -36,7 +36,7 @@
3636

3737
<item>
3838
<title>Visual Explanation of Python NumPy Library</title>
39-
<description>NumPy is one of the popular Python libraries. In this article, we’ll understand its usage with graphics and more practical approach. So you can visually relate and remember it.
39+
<description>NumPy is one of the popular Python libraries. In this article, we’ll understand its usage with graphics and more practical approach. So you can visually relate and remember it.;
4040
</description>
4141
<pubDate>Sat, 04 Nov 2023 00:00:00 +0000</pubDate>
4242
<link>https://solothought.com/tutorial/python-numpy/</link>
@@ -76,7 +76,7 @@
7676

7777
<item>
7878
<title>Python List - Quick Reference</title>
79-
<description>Just remember &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;list[start:end:-steps]&lt;/code&gt;. That’s all!
79+
<description>Just remember &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;list[start:end:-steps]&lt;/code&gt;. That’s all!;
8080
</description>
8181
<pubDate>Sun, 22 Oct 2023 00:00:00 +0000</pubDate>
8282
<link>https://solothought.com/tutorial/python-list-quick-ref/</link>
@@ -90,7 +90,7 @@
9090

9191
<item>
9292
<title>Fast XML Parser v5 - Pre release</title>
93-
<description>You decide what to change next
93+
<description>You decide what to change next;
9494
</description>
9595
<pubDate>Sat, 14 Oct 2023 00:00:00 +0000</pubDate>
9696
<link>https://solothought.com/info/fxp-5-prerelease/</link>
@@ -104,7 +104,7 @@
104104

105105
<item>
106106
<title>Amir Wishu Sehgal cafe: The story of opportunities</title>
107-
<description>Amir Wishu Sehgal, a 23-year-old with dreams as vast as the open sky, resided in a small flat on rent. This humble abode happened to be in the same building as Gurutaap’s shop. The building was nestled in a close-knit community where people may not have been wealthy in material possessions, but they possessed hearts filled with warmth and generosity. It was a place where neighbors knew each other by name, where doors were always open for a cup of tea and a friendly chat.
107+
<description>Amir Wishu Sehgal, a 23-year-old with dreams as vast as the open sky, resided in a small flat on rent. This humble abode happened to be in the same building as Gurutaap’s shop. The building was nestled in a close-knit community where people may not have been wealthy in material possessions, but they possessed hearts filled with warmth and generosity. It was a place where neighbors knew each other by name, where doors were always open for a cup of tea and a friendly chat.;
108108
</description>
109109
<pubDate>Tue, 18 Jul 2023 00:00:00 +0000</pubDate>
110110
<link>https://solothought.com/tutorial/aws-story/</link>
@@ -118,7 +118,7 @@
118118

119119
<item>
120120
<title>Chapter 2: The Preparation of Battle</title>
121-
<description>The Java valley is always under the threat. So all the masters must be prepared all the time.
121+
<description>The Java valley is always under the threat. So all the masters must be prepared all the time.;
122122
</description>
123123
<pubDate>Thu, 29 Jun 2023 00:00:00 +0000</pubDate>
124124
<link>https://solothought.com/tutorial/the-preparation-of-battle/</link>

sitemap.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177
<url>
178178
<loc>https://solothought.com/about</loc>
179179

180-
<lastmod>2023-11-26T02:18:59+00:00</lastmod>
180+
<lastmod>2023-11-26T06:58:44+00:00</lastmod>
181181

182182

183183
<changefreq>monthly</changefreq>
@@ -202,7 +202,7 @@
202202
<url>
203203
<loc>https://solothought.com/privacypoicy</loc>
204204

205-
<lastmod>2023-11-26T02:18:59+00:00</lastmod>
205+
<lastmod>2023-11-26T06:58:44+00:00</lastmod>
206206

207207

208208
<changefreq>monthly</changefreq>
@@ -221,7 +221,7 @@
221221
<url>
222222
<loc>https://solothought.com/termandconditions</loc>
223223

224-
<lastmod>2023-11-26T02:18:59+00:00</lastmod>
224+
<lastmod>2023-11-26T06:58:44+00:00</lastmod>
225225

226226

227227
<changefreq>monthly</changefreq>

tutorial/aws-story/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,11 +742,11 @@ <h2>Related Articles</h2>
742742

743743

744744

745-
<h5><a href="/tutorial/the-preparation-of-battle/">Chapter 2: The Preparation of Battle</a></h5>
745+
<h5><a href="/tutorial/kungfu-java-concepts/">Story of Kungfu Java Valley</a></h5>
746746

747747

748748

749-
<h5><a href="/tutorial/kungfu-java-concepts/">Story of Kungfu Java Valley</a></h5>
749+
<h5><a href="/tutorial/the-preparation-of-battle/">Chapter 2: The Preparation of Battle</a></h5>
750750

751751

752752

tutorial/kungfu-java-concepts-explanation/index.html

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,25 @@ <h3 id="method-overriding-and-shadowing">Method Overriding and shadowing</h3>
793793
<span class="o">}</span>
794794
<span class="o">}</span>
795795
</pre></td></tr></tbody></table></code></pre></div></div>
796+
<p>In easy words, you can say overriding is a kind of shadowing that happens when child class implement the same method of parent class.</p>
797+
798+
<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
799+
2
800+
3
801+
4
802+
5
803+
6
804+
7
805+
8
806+
</pre></td><td class="rouge-code"><pre><span class="kd">public</span> <span class="kd">class</span> <span class="nc">ShadowingExample</span> <span class="o">{</span>
807+
<span class="kd">private</span> <span class="kt">int</span> <span class="n">num</span> <span class="o">=</span> <span class="mi">10</span><span class="o">;</span> <span class="c1">// Class-level variable</span>
808+
809+
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">shadowMethod</span><span class="o">()</span> <span class="o">{</span>
810+
<span class="kt">int</span> <span class="n">num</span> <span class="o">=</span> <span class="mi">20</span><span class="o">;</span> <span class="c1">// Local variable shadowing the class-level variable</span>
811+
<span class="nc">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Local variable num: "</span> <span class="o">+</span> <span class="n">num</span><span class="o">);</span> <span class="c1">// Prints the value of the local variable</span>
812+
<span class="o">}</span>
813+
<span class="o">}</span>
814+
</pre></td></tr></tbody></table></code></pre></div></div>
796815

797816
<p>I hope I have covered all the concepts. I explained in the original story.</p>
798817

@@ -1106,15 +1125,15 @@ <h2>Related Articles</h2>
11061125

11071126

11081127

1109-
<h5><a href="/tutorial/kungfu-java-concepts/">Story of Kungfu Java Valley</a></h5>
1128+
<h5><a href="/tutorial/aws-story/">Amir Wishu Sehgal cafe: The story of opportunities</a></h5>
11101129

11111130

11121131

1113-
<h5><a href="/tutorial/aws-story/">Amir Wishu Sehgal cafe: The story of opportunities</a></h5>
1132+
<h5><a href="/tutorial/the-preparation-of-battle/">Chapter 2: The Preparation of Battle</a></h5>
11141133

11151134

11161135

1117-
<h5><a href="/tutorial/the-preparation-of-battle/">Chapter 2: The Preparation of Battle</a></h5>
1136+
<h5><a href="/tutorial/kungfu-java-concepts/">Story of Kungfu Java Valley</a></h5>
11181137

11191138

11201139

tutorial/python-list-quick-ref/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,11 +841,11 @@ <h2>Related Articles</h2>
841841

842842

843843

844-
<h5><a href="/tutorial/python-numpy/">Visual Explanation of Python NumPy Library</a></h5>
844+
<h5><a href="/tutorial/python-function-quick-ref/">Python Method - Quick Reference</a></h5>
845845

846846

847847

848-
<h5><a href="/tutorial/python-function-quick-ref/">Python Method - Quick Reference</a></h5>
848+
<h5><a href="/tutorial/python-numpy/">Visual Explanation of Python NumPy Library</a></h5>
849849

850850

851851

tutorial/python-numpy/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,11 +1021,11 @@ <h2>Related Articles</h2>
10211021

10221022

10231023

1024-
<h5><a href="/tutorial/python-list-quick-ref/">Python List - Quick Reference</a></h5>
1024+
<h5><a href="/tutorial/python-function-quick-ref/">Python Method - Quick Reference</a></h5>
10251025

10261026

10271027

1028-
<h5><a href="/tutorial/python-function-quick-ref/">Python Method - Quick Reference</a></h5>
1028+
<h5><a href="/tutorial/python-list-quick-ref/">Python List - Quick Reference</a></h5>
10291029

10301030

10311031

tutorial/the-preparation-of-battle/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,11 +1106,11 @@ <h5><a href="/tutorial/kungfu-java-concepts/">Story of Kungfu Java Valley</a></h
11061106

11071107

11081108

1109-
<h5><a href="/tutorial/aws-story/">Amir Wishu Sehgal cafe: The story of opportunities</a></h5>
1109+
<h5><a href="/tutorial/kungfu-java-concepts-explanation/">Story of Kungfu Java Valley - Explanation</a></h5>
11101110

11111111

11121112

1113-
<h5><a href="/tutorial/kungfu-java-concepts-explanation/">Story of Kungfu Java Valley - Explanation</a></h5>
1113+
<h5><a href="/tutorial/aws-story/">Amir Wishu Sehgal cafe: The story of opportunities</a></h5>
11141114

11151115

11161116

0 commit comments

Comments
 (0)