.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Interview Question >> JavaScript/VBScript >> Post New Question Subscribe to Interview Questions

What is non static block in java?

Posted By :Ghanashyam Nayak     Posted Date :September 28, 2010    Points :10   Category :JavaScript/VBScript 
Any code written between a { and a } is a non-static block.

for example:

// some code goes here
The non-static block code is executed when a new class is instantiated. It executes before the constructor's execution. Apart from initialization, any other execution like calculation could be given in the non-static block, as a constructor is used for initializing purpose.

You can also find related Interview Question to What is non static block in java?  below: 

Difference between type constructor and instance constructor? What is static constructor, when it will be fired? And what is its use?

(Class constructor method is also known as type constructor or type initializer)
Instance constructor is executed when a new instance of type is created and the class constructor is executed after the type is loaded and before any one of the type members is accessed. (It will get executed only 1st time, when we call any static methods/fields in the same class.) Class constructors are used for static field initialization. Only one class constructor per type is permitted, and it cannot use the vararg (variable argument) calling convention. (More...)

Can code inside multiple catch block be executed?

No, Code can not execute in mutiple catch block (More...)

Can a .NET web application consume Java web service?

Yes Offcourse.Actually Webservices are independent to language. it depends on WSDL and SOAP. so any one can develope the Webservices anddisclose the wsdl and users can consume the webservices.wsdl and soap both are xml based.. and all languages having xml parsing
capability and access to http protocol will be able to work with Webservices. (More...)

Can you declare an override method to be static if the original method is not static?

No. The signature of the virtual method must remain the same.
(Note: Only the keyword virtual is changed to keyword override). (More...)

Is it possible to have a static indexer in C#?

No. Static indexers are not allowed in C#. (More...)

What is Static Constructor?

It is invoked when the instance of the class is created. (More...)

How to add a combo box dynamically at run time in Java script?

document.forms[0]..options[index] new Option("Add text Value") (More...)

What is dynamic binding ? How is it different from static binding?

With dynamic binding, the decision on which object method to call is made at runtime.Dynamic binding is polymorphism. with static binding, the decision to on which method to call is made at compile time.c# uses static binding as the default method dispatching mechanism. (More...)

Static datamembers should be initialized inside the constructor. True or False.

False. Static datamembers should not be initialised inside constructor. (More...)

What is TCB(Transmission Control Block)?

A TCB is a complex data structure that contains informations about each connection. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend