<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Static Block, Static Variable and Static Method	</title>
	<atom:link href="https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/</link>
	<description>AI, Salesforce, ServiceNow &#38; Enterprise Tech Guides</description>
	<lastBuildDate>Fri, 28 May 2021 08:33:15 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Pratik Ghosh		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-6679</link>

		<dc:creator><![CDATA[Pratik Ghosh]]></dc:creator>
		<pubDate>Fri, 28 May 2021 08:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-6679</guid>

					<description><![CDATA[I have a public static variable and two static methods say method_1 and method_2 in my apex class. Say the variable name is x.  Now I have assigned a value to variable x in method_1. Now when I try to access the value for variable x in method_2, I get null even if method_1 is called at the time of page load and before method_2 gets called.]]></description>
			<content:encoded><![CDATA[<p>I have a public static variable and two static methods say method_1 and method_2 in my apex class. Say the variable name is x.  Now I have assigned a value to variable x in method_1. Now when I try to access the value for variable x in method_2, I get null even if method_1 is called at the time of page load and before method_2 gets called.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sumittiwari300694		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-4285</link>

		<dc:creator><![CDATA[sumittiwari300694]]></dc:creator>
		<pubDate>Wed, 04 Apr 2018 06:21:30 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-4285</guid>

					<description><![CDATA[Thank you for the valuable post about static method as i was in confusion but now its clear , It is going to help me a lot. Hope you will keep on posting to update us]]></description>
			<content:encoded><![CDATA[<p>Thank you for the valuable post about static method as i was in confusion but now its clear , It is going to help me a lot. Hope you will keep on posting to update us</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JitendraZaa		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-2280</link>

		<dc:creator><![CDATA[JitendraZaa]]></dc:creator>
		<pubDate>Thu, 25 Sep 2014 16:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-2280</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-2277&quot;&gt;Atul&lt;/a&gt;.

This article is not about C#]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-2277">Atul</a>.</p>
<p>This article is not about C#</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Atul		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-2277</link>

		<dc:creator><![CDATA[Atul]]></dc:creator>
		<pubDate>Thu, 25 Sep 2014 05:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-2277</guid>

					<description><![CDATA[C# don&#039;t have static blocks]]></description>
			<content:encoded><![CDATA[<p>C# don&#8217;t have static blocks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: abcd993		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-201</link>

		<dc:creator><![CDATA[abcd993]]></dc:creator>
		<pubDate>Sat, 29 Jun 2013 07:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-201</guid>

					<description><![CDATA[so you mean static block will be loaded to stack before the main method?]]></description>
			<content:encoded><![CDATA[<p>so you mean static block will be loaded to stack before the main method?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: venkat		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-200</link>

		<dc:creator><![CDATA[venkat]]></dc:creator>
		<pubDate>Wed, 23 Jan 2013 08:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-200</guid>

					<description><![CDATA[Hi,

I am new apex and visualforce. I have simple question. Why we write &quot;static&quot; keyword for test methods.

Thanks in advance.]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>I am new apex and visualforce. I have simple question. Why we write &#8220;static&#8221; keyword for test methods.</p>
<p>Thanks in advance.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Guest		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-199</link>

		<dc:creator><![CDATA[Guest]]></dc:creator>
		<pubDate>Tue, 28 Aug 2012 05:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-199</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-195&quot;&gt;Knowledge_the_power&lt;/a&gt;.

static block]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-195">Knowledge_the_power</a>.</p>
<p>static block</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: JitendraZaa		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-198</link>

		<dc:creator><![CDATA[JitendraZaa]]></dc:creator>
		<pubDate>Mon, 12 Mar 2012 07:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-198</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-197&quot;&gt;surekha&lt;/a&gt;.

Hi Surekha,
Can you explain what you want to say?

The error is saying you have to create ovject and then access method via object OR declare method as static.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-197">surekha</a>.</p>
<p>Hi Surekha,<br />
Can you explain what you want to say?</p>
<p>The error is saying you have to create ovject and then access method via object OR declare method as static.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: surekha		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-197</link>

		<dc:creator><![CDATA[surekha]]></dc:creator>
		<pubDate>Mon, 12 Mar 2012 07:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-197</guid>

					<description><![CDATA[
I:&#062;javac nonStaticMethod.java
nonStaticMethod.java:7: non-static method myMethod() cannot be referenced from a
Â static context
Â Â Â  myMethod();
Â Â Â  ^
1 error
]]></description>
			<content:encoded><![CDATA[<p>I:&gt;javac nonStaticMethod.java<br />
nonStaticMethod.java:7: non-static method myMethod() cannot be referenced from a<br />
Â static context<br />
Â Â Â  myMethod();<br />
Â Â Â  ^<br />
1 error</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Anonymous		</title>
		<link>https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-196</link>

		<dc:creator><![CDATA[Anonymous]]></dc:creator>
		<pubDate>Wed, 08 Feb 2012 07:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://JitendraZaa.com/blog/?p=545#comment-196</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-195&quot;&gt;Knowledge_the_power&lt;/a&gt;.

Hi,
The complete class is loaded in a single shot and then execution occurs as per sequence in which they are written.

If you have SOP statements in Static blocks and Static Method. It will execute the statements of Static block only and to execute statement of static method you have to call it from somewhere. This doe not mean that Static block is loaded before method.

Regards,
Jitendra Zaa
]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/java/static-block-static-variable-and-static-method/#comment-195">Knowledge_the_power</a>.</p>
<p>Hi,<br />
The complete class is loaded in a single shot and then execution occurs as per sequence in which they are written.</p>
<p>If you have SOP statements in Static blocks and Static Method. It will execute the statements of Static block only and to execute statement of static method you have to call it from somewhere. This doe not mean that Static block is loaded before method.</p>
<p>Regards,<br />
Jitendra Zaa</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: www.jitendrazaa.com @ 2026-05-23 14:10:48 by W3 Total Cache
-->