Register on the forum now to remove ALL ads + popups + get access to tons of hidden content for members only!

Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > Java

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 11-16-2017, 03:01 AM   #1
sunled
Registered User
 
Join Date: Nov 2017
Posts: 314
What is static block?

What is static block?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
sunled is offline   Reply With Quote

Old 11-16-2017, 06:55 AM   #2
Lebar.123
Registered User
 
Join Date: Nov 2017
Posts: 530
A static block refers to a variable that will not change value, which is a bit counter-intuitive.
__________________
Get your email validated by our
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
@ ZeroBounce
Lebar.123 is offline   Reply With Quote
Old 11-23-2017, 04:20 AM   #3
BryceBrady
Registered User
 
Join Date: Oct 2016
Posts: 776
Static block is used for initializing the static variables.This block gets executed when the class is loaded in the memory. A class can have multiple Static blocks, which will execute in the same sequence in which they have been written into the program.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
BryceBrady is offline   Reply With Quote
Old 11-23-2017, 05:19 AM   #4
Ryan David
Registered User
 
Join Date: Sep 2017
Location: dover
Posts: 92
Static square is utilized for introducing the static variables.This piece gets executed when the class is stacked in the memory. A class can have different Static pieces, which will execute in a similar grouping in which they have been built into the program.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Ryan David is offline   Reply With Quote
Old 11-30-2017, 02:35 AM   #5
travelowebseo
Registered User
 
Join Date: Sep 2017
Posts: 84
A static initialization block is a normal block of code enclosed in braces, { }, and preceded by the static keyword. Here is an example: static { // whatever code is needed for initialization goes here } A class can have any number of static initialization blocks, and they can appear anywhere in the class body.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
travelowebseo is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What if I write static public void instead of public static void? sunled Java 0 11-16-2017 02:27 AM
Static Vs Dynamic jaysh4922 Programming General 1 04-14-2015 12:44 AM
Static URL? jamesranatte Review My Website 5 01-02-2014 11:41 PM
Block vs. inline level elements davikerkrish HTML / DHTML 0 09-06-2012 05:16 AM
static or pseudo-static web pages? hostingcoupons Web Promotion 0 05-14-2012 03:36 AM


All times are GMT -7. The time now is 12:32 AM.


Powered by vBulletin Copyright © 2013 vBulletin Solutions, Inc.