what is the difference between statis block and static
variable

Answer Posted / kiran

static variable are access and executed with objects or
methods(static or non-static) its a dependent.
static block executed and access independently when the
program starts

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is concurrent hashmap and its features?

754


How do you bind variables?

769


When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

758


What is finalize()?

867


What is the synchronized method modifier?

844


Can Exception handling we can handle multiple catch blocks?

827


Can we call thread start () twice?

705


What are keywords give examples?

793


What is a local class in java?

786


Write a program to solve producer consumer problem in java?

756


What do the thread?class methods run() and start() do?

778


What is difference between path and classpath?

774


Define an enumeration?

801


What’s the difference between constructors and other methods?

738


Why static functions are used?

791