Home Tutorialhelp Comment sir please tell me why we use static variable.

 
 

Comment

hardesh kumar
sir please tell me why we use static variable.,
February 1, 2007 at 12:40 PM

sir please tell me why we use static variable.
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
JSP Tutorials

Understanding Hello World Java Program
Understanding Hello World Java Program   ...[] args) {    System.out.println("Hello, World...("Hello, World"); prints the "Hello World" on the console 

Java Beginners

please tell me
please tell me  why we use public static main(String ar){} in java instead of main 

Java Beginners

hello sir, please give me answer - Java Beginners
hello sir, please give me answer  Write a program in Java that calculates the sum of digits of an input number, prints... ways in java? so , sir please tell me full solution of this program   Here is your complete 

Servlet Interview Questions

please tell me
please tell me  why we are using http protocol in servlets 

SQL Question

please tell me
please tell me  which cmd we use to clear the screen in sql prompt 

Java Beginners

please tell me
-static variable wanted c text available = available - wanted; ^ please tell me the resolution   class Reserve...please tell me  class Reserve extends Thread{ int available=1 

Java Beginners

Static Variable
Static Variable  What is the basic use of introducing static variable type in java?Please explain clearly....   The Static means..., it means that the static variable is shared among all instances of the class 

Java Beginners

why and where we use setter and getter methods in java, please give me one example program.....
why and where we use setter and getter methods in java, please give me one example program.....  why and where we use setter and getter methods in java, please give me one example program 

Java Beginners

Tell me - Java Beginners
Tell me   how to create a valid.js file please tell me and give the write code Thanks  Hi friend, Please give details for requirement of this "valid.js" file. For read more information http 

Hibernate Questions

Why we use singleton class in hibernate sessionfactory?
Why we use singleton class in hibernate sessionfactory?  Hello, Please tell me why we use singleton class in hibernate sessionfactory? hibernate sessionfactory singleton example would be very helpful. Thanks 

Java Beginners

static
Static Concept  in what are all the situation we may use static...,then use static blocks and without creation of object we need to perform some task... is why if you declare the function main as static then java does not have 

Java Beginners

please tell me
please tell me  what are the topics in core and advaced java....   Hi Friend, Please visit the following links: http://www.roseindia.net/ http://www.roseindia.net/java/ Thanks   Hi Friend, Please visit 

Java Beginners

please tell me
please tell me  import java.lang.Thread; class Current{ public static...(); ^ 1 error tell me the resolution please....   import java.lang.Thread; class Current{ public static void main(String ar[]){ Thread t 

Java Beginners

please tell me
please tell me  Actually i am working on a Project tiitle is JavaMail System, 1)How to configure java mail API and a Demo Program for Sending mail and Receiving using JSP and Servlet 

Java Beginners

please tell me
, but its compiled and run successfully, please tell me the reason...please tell me  class Person{ int age; String name; void Person1... is:"+age); } } class Hash{ public static void main(String ar[]){ Person obj1=new 

Java Beginners

please tell me
: '}' expected ^ 2 errors, i got this error....... please tell me the resolution...please tell me  class Person{ string name; int age; void...("my age is"+age); } } class Hash(){ public static void main 

Java Beginners

please tell me
please tell me  import java.io.*; class SString{ public static void...)); ^ 1 error please tell me the resolution of this   Hi... SString{ public static void main(String ar[]) throws IOException 

Java Beginners

please tell me
(10.6,20.0); ^ 1 error, please tell me the resolution for this...   ...please tell me  class Sample{ private double num1,num2; void sample...; System.out.println("sum"+result); } } class Methods{ public static void main(String 

Java Beginners

please tell me
please tell me  class Person{ int age; String name; void talk(){ System.out.println("my name is:"+name); System.out.println("my age is:"+age); } } class Hash{ public static void main(String ar[]){ Person raju=new Person 

Java Beginners

Why we should use string args[] in main method in java?
Why we should use string args[] in main method in java?  we use only string in the main method not any other one.. specify the reason... and tell me each and every meaning of public static void main(String args[])...    

Java Beginners

please tell me
got error as Inner class connot have static declarations pls tell me...please tell me  class Producer extends Thread { StringBuffer sb...){} System.out.println(prod.sb); } } class Threadcom1 { public static void main 

EJB Questions

Please guide me sir - EJB
Please guide me sir  Hi I am Pradeep singh ,done SCJP 5.0 and SCWCD 5.0 .Now i want to learn further .So please tell me whether should i learn EJB... next? Because both can do same work.Please advice me .At present i am jobless 

Java Beginners

please do respond to my problem sooooon sir - Java Beginners
please do respond to my problem sooooon sir  Hello sir, Sir i have... to open the link also in my own browser.Hope you will help me out.And also sir i need... buttons as in internet exoplorer such as search bar and some more buttons.Sir help me 

Swing AWT

Software graduates please tell me,
Software graduates please tell me,  How to view image on Frame in swing(or)awt in Java 

Swing AWT

Software graduates please tell me,
Software graduates please tell me,  How to view image on Frame in swing(or)awt in Java 

Java Beginners

please help me - Java Beginners
please help me   I have some error in this programe //write acomputer programe using java to generate following series : //output: //1,2,3,0,-2,7,-4..... class Series1HW { public static void main(String args 

Java Beginners

Why is the main method declared static?
Java class always has the same signature, and we declare public static void main... without creating any instance for the java class, where we declared it. Any static... the static method. For more visit http://www.roseindia.net/java/beginners 

Java Beginners

please tell me about command line arguments in java?
please tell me about command line arguments in java?  please tell me about command line arguments in java?   Hi Friend, The command-line.../java/beginners/cmnd-line-arguments.shtml Thanks 

Java Beginners

static & instance - Java Beginners
static & instance  what is different between static variable and instance variable .? plz explain with example. and when we can use static variable and when can use instance variable.    public class Main 

Java Beginners

why we use design patterns in java?Example?
why we use design patterns in java?Example?  Hi..... Why we use design patterns?,why they are needed in programming languages?,advantages?   hi friend, please go through the following links may this will be helpful 

Java Interview Questions

static
static  What is the exact need of declaring a variable as static?   A static variable is a variable who's single copy in memory is shared by all objects,so any modifications to the static variable will modify it's value 

Java Interview Questions

Please find me a solution that
Please find me a solution that   Write a java program.... f. Do not use Instance Variable for your program. Class "AreaTest" has.... d. Void Circle Method has one parameter which is radius. You must use Math.PI 

Java Beginners

how to inherit static variable
how to inherit static variable   how to inherit static variable or methods in Java?? Please explain the entire process of inheriting the variable. Thanks in advance 

Java Beginners

please tell me the flow of execution of this program
please tell me the flow of execution of this program  class Test{ int x; Test(int x){ this.x=x; } static void access(){ System.out.println("x= "+x); }} class Static{ public static void main(String ar[]){ Test obj=new Test(55 

Java Beginners

please help me in a java program !! - Java Beginners
please help me in a java program !!  the porgram should use kosaraju's algorithm to detect the strong connected components in a graph (http... class Graph class DFSApp { public static void main(String[] args 

Java Beginners

core java, static - Java Beginners
core java, static  Dear sir, in java non-static fields can not be accessed in a static field. But if we create an object of class type in static... ( Ultimately this is what we do in static main method). So is right to say 

SQL Question

please tell me
please tell me  i have created one table,when i close and again login, table name will be there, but its content not displayed, showing as no rows selected, please tell me the reason 

SQL Question

please tell me
please tell me  select * from emp order by 5 desc; in the above what is the meaning of 5, and what its functionality 

Java Beginners

please tell me the difference between local variable, staitic variables, and instance variables....
please tell me the difference between local variable, staitic variables, and instance variables....  please tell me the difference between local variable, staitic variables, and instance variables 

Java Beginners

please tell me
please tell me   <tr> <td><html:hidden property="tid" value="${user.id}"/></td> <td><bean:write name="user" property="emp_name"/> 

Java Beginners

please tell me
please tell me  Blockquote Blockquote> BlockquoteBlockquote how to get images from ms access databases to jsp pagesBlockquote   Jsp get image from ms access database Create a table named user(id,name,address,image 

Java Beginners

tell me coding for this
tell me coding for this  Write an application that displays the integer equivalents of the following character...A   Java get Integer value of Character class GetIntValueOfCharacter { public static void main 

Hibernate Interview Questions

Why do we use ORM?
Why do we use ORM?  Why do we use ORM?   ORM is technology... programming. In ORM we define the way of mapping of classes to table and also define the mapping of which property for which column. In ORM we can use plain java 

JSP Servlet Questions

please tell me
please tell me  what is the source code if user give wrong user name password the explorer will show incorrect username password   <...); } %> For more information, please go through the following link: http 

Java Beginners

why we use constructors instead of methods in java?
why we use constructors instead of methods in java?   why we use constructors instead of methods in java 

Java Beginners

plz tell me
plz tell me  how to get no. of times the 'button' is pressed   Here is a java swing code that counts the number of times the button clicked... CountButtonClicks extends JFrame{ public static void main(String[] args){ new 

Java Beginners

Reply me - Java Beginners
in the database... if u understood my question then then please send me code oterwise tell me its urgent package services; import java.sql.Connection; import...Reply me  Hi, this code is .java file but i am working in jsp 

Java Beginners

Reply Me - Java Beginners
use this i don't know... please tell me what is the use of this ....and also solve my previous problem.... Thanks   Hello Ragini MVC...,html files Model contian bean class and pojo class through which we interact 

Java Beginners

please tell me what is ment by wrapper class in java........
please tell me what is ment by wrapper class in java........  what is ment by wrapper class in java 

Java Beginners

why we use abstract class in java?
why we use abstract class in java?  what is the the purpose of abstract class.Give example when to use abstract and when use interface 

General

Example of a class variable (static variable)
Example of a class variable (static variable)   ... you can define the static class variable in a class. When a number of objects... of a class variable. It will be updated each time the instance has been called. We 

Java Beginners

Why we are writting public static void main(String args[])?
Why we are writting public static void main(String args[])?  Why we are writting public static void main(String args[])? please elaborate it... and also explain the statement System.out.println("abc 

Java Beginners

Please help me??
Please help me??  Question_1: Using one-dimension array of primitive...: Using Collection Framework Objective: To understand the use of List interface and Iterator. Step1: Create a new java file FileName: ListDemo.java import 

Java Beginners

hi sir - Java Beginners
the details sir, Thanks for ur coporation sir  Hi Friend, Please visit the following link: http://www.roseindia.net/java/java-tips...hi sir  Hi,sir,i am try in netbeans for to develop the swings,plz 

SQL Question

Please help me out
Please help me out    Description* You are hired to develop a laptop... or Eclipse), you should develop a Java application to provide these services... should be designed in MySQL. For this purpose you will need to use 

Java Beginners

plz tell me the code & execution process - Java Beginners
plz tell me the code & execution process  Write a program to download... URLConnectionReader{ public static void main(String[] args) throws Exception { URL... is: "); System.out.println(str); } } For more information on Java 

Java Beginners

please tell me about command line arguments in java?
please tell me about command line arguments in java?  please tell me about command line arguments in java?   Hi Friend, The command-line arguments are the arguments which are sent to the program being called. You can 

General Information

static keyword in java
:- A static variable is a special function in java programming language. We can create... .style1 { color: #0000FF; } static keyword in java We are going... and is not linked with an instance of a class. We can use static keyword, static 

Java Beginners

Tell me where we are using overloading and overriding in realtime project?
Tell me where we are using overloading and overriding in realtime project?  Hi,Tell me where we are using overloading and overriding in realtime project? please give me answer 

Java Beginners

sir - Java Beginners
sir   hi sir,in this program there is a jtable,i am insert... sir,i am mentioning the error as <<>>>......main bug here>........ in this program,plz see and provide solution sir,database Tables 

Java Beginners

sir - Java Beginners
sir   hi sir,Happy ugadi,how to place the database records into jtable ,i am using the oracle database plz provide the program how to retrieve...*; public class JTableDatabase{ JCheckBox check; public static void main 

Java Beginners

please help me to give code - Java Beginners
please help me to give code  Write a program that reads a file named...(); } } } ------------------------------- read for more information, http://www.roseindia.net/java/beginners/read... java.io.IOException; public class ReadFileExample{ public static void 

Java Beginners

Using a variable filename - Java Beginners
Using a variable filename  Dear sir, my program a JFrame containes... and click button2, it should go to data2.txt file. Can you please help me... the buttons global variable and using the code e.getSource()== or by associating 

Java-Tutorials

Java coding for beginners
) Writing Hello World Java program Understanding Hello World Java Program Java Beginners tutorial Home page... are beginners for the program. It you want to test these codes then you can use the java 

Java Beginners

sir - Java Beginners
javax.swing.table.*; public class InsertRows{ public static void main 

Java Beginners

to all Experts.. please help me. im using a Jcreator. - Java Beginners
to all Experts.. please help me. im using a Jcreator.  3. Write... ILOVEU ILOVEU ILOVEU ILOVEU To do this you will need to use the length...{ public static void main(String[] args) { System.out.println("Enter word 

Java Beginners

please help me to give code - Java Beginners
please help me to give code  Write a program that prints an n-level..., import java.io.*; public class PrintExamp{ public static void main..., http://www.roseindia.net/java 

Programming Tutorials

Java static method example
Description: Static variable are used within the static method. Non static variable do not exits in the static method. Static variables are shared by its class instances. Static variable can be used without using the instances 

Java Beginners

please help me for this program - Java Beginners
please help me for this program   Write a program that asks the user for a starting value and an ending value and then writes all the integers... java.util.*; public class Numbers{ public static void main(String[]args 

Java Beginners

please help me to give code - Java Beginners
please help me to give code  Write a program that uses loops to generate an n x n times table. The program should get n from the user. As a model... class PrintStar{ public static void main(String[] args){ int k; for(k = 1 

Java Beginners

Reply me - Java Beginners
then adll data would be displaying. so please tell me what is incorrect my code and i want to use session in each page then please tell me that how can i use Thanks   Hi friend, Give in details and also 

Java Beginners

arrays,why we cannot use this statement
arrays,why we cannot use this statement  import java.util.*; class Dash{ public static void main(String args[]){ int x0=100; int[] x1=new int[3]; int[][] x2=new int[3][3]; int[][][] x3 

Java Beginners

arrays,why we cannot use this statement
arrays,why we cannot use this statement  import java.util.*; class Dash{ public static void main(String args[]){ int x0=100; int[] x1=new int[3]; int[][] x2=new int[3][3]; int[][][] x3 

Java Beginners

please help me here.. - Java Beginners
please help me here..  ..uhhmm.. im a little bit new to java and i go... class CaseStudy1 { public static void main(String[] args) throws IOException... static void main(String[] args) throws IOException{ System.out.println("String 

PHP Tutorial

PHP Static Variable and Methods
PHP Static Methods and Variables: In this tutorial we will study when we should use static methods and variables. Static keyword is used to make only one... the all objects of that class. If we declare a method as static then we can access 

Java Beginners

help please - Java Beginners
work with me and i dont know where is exactly the error this is the code i... java.io.IOException; public class DataToBinary{ public static void main(String... friend, We check the code having some changes to correct the code 

JavaMail Questions

sir i,have a assignment for these question plz help me sir - JavaMail
sir i,have a assignment for these question plz help me sir   1.Design a Java interface for ADT Stack. Develop two different classes... class hierarchy in Java. Write a test program to demonstrate polymorphism   

Java Beginners

STATIC VARIABLE DECLARATION
STATIC VARIABLE DECLARATION  why cannot the static variable declare inside the method 

Java Beginners

static
static  what r the main uses of static in java   Hi Friend, The Static means that a certain object/variable is resident in memory... is applied to member variables, it means that the static variable is shared among all 

Java Beginners

about static import - Java Beginners
about static import  Hello Friend below program is not running when... is not static. Use public modifier instead of protected modifier in Class... i compile B.class it is showing the compile time error on variable i. i want 

Java Tips and Examples

Example of a instance variable
variable in a main method. If we try to call the non-static method in the main... be referenced from a static context. We can call the non-static variable by the instance..., not the updated one . In this program we are showing that how a instance variable 

Java Beginners

static
redeclare static variable in the inherited class  can we redeclare static variable in the inherited class like this: public class StaticClass1...); **//here i have redeclared the static variable as "25" is it possible,then what 

Java Beginners

Can we declare a static variable inside a method?
Can we declare a static variable inside a method?   Hi, Can we declare a static variable inside a method? thanks 

Development process Questions

sir, how to convert excel file to csv file using java? please send me sample code.
sir, how to convert excel file to csv file using java? please send me sample code.  please send me sample code for converting excel file into csv file uisng java 

Java Beginners

more doubts sir. - Java Beginners
more doubts sir.  Hello sir, Sir i have executed your code... own browser.Hope you will help me out.And also sir i need the progressbar... exoplorer such as search bar and some more buttons.Sir help me out 

Java Beginners

Reply Me - Java Beginners
based onsearching Search with name alphabetical order please understood,if u not understood then please tell me Thanks   ...Reply Me  Hi, I m working in jsp please any information provide 

Java Beginners

urgent...pleAse help me.....please!
urgent...pleAse help me.....please!  please help me urgent! how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks 

Java Beginners

Serialize the static variable
Serialize the static variable  hello, Can we serialize the static variable?   hii Yes we can serialize the static variable. if u don't want to serialize, u need to declare the variable as transient 

Java Beginners

Reply Me - Java Beginners
  Hi, In which technology we should developed the example. * JSP * Servlets * Struts 1 * Struts 2 or JSF? Please tell me 

Java Beginners

Help me please!!! - Java Beginners
Help me please!!!  im badly needing the complete code for this project in java!!! can you please help me???!!! it is about 1-dimensional array... the answers 8Hours from now!!! Kindly help me!! please!!please!!! NOTE 

JSP Servlet Questions

Why request.getParameter(
="POST"> why it happen? Anybody plz help me.. i want use it my project...plz...Why request.getParameter(  Hi all, I want to to do upload file in my... to variable then it return as null. ex. request.getParameter("demofield") gives null 

Java Beginners

ABUT A FUNCTION AND ITS USE - Java Beginners
ABUT A FUNCTION AND ITS USE  SIR CAN U PLEASE TELL ME ABOUT parseInt(args[i]) a)its use? b)when it is used? C)is it related to string class 

Java Beginners

class static - Java Beginners
information on Static in Java visit to : http://www.roseindia.net/java/beginners...class static  When do we declare a member of a class static?  Hi friend, public class HowToAccessStaticMethod{ int i; static int j 

Java Beginners

java please please help
java please please help  Dear Friends plz help me to complete this program import java.util.*; public class StringDemo { static String a="{a=100;b=200;c=300}"; public static void main(String args 

Java Beginners

Please tell me the code to generate the below structure
Please tell me the code to generate the below structure  1 2 3 4 5 6 7 8 9 1 2 3 4 6 7 8 9 1 2 3 7 8 9 1 2 8 9 1 9 1 2 8 9 1 2 3 7 8 9 1 2 3 4 6 7 8 9 1 2 3 

Java Beginners

Reply me - Java Beginners
Reply me  Hi Friends, Quest:- Tell em what is the difference between java and php, dotnet Quest:- what is the similar point of php and java... Please tell me its very urgent 

Java Beginners

Please help me
Please help me  Hi Sir, please send me the code for the following... java.util.*; public class SetsUnion{ public static void main(String[] args){ Set... is: "+l); } } 2) import java.util.*; class ReverseWords{ public static void 

Java Beginners

help me please
help me please  how can i do dictionary with the use of array code in java, where i will type the word then the corresponding meaning for that word will appear...thanks 

Swing AWT

please give me a java program for the following question
please give me a java program for the following question  Write a java program that displays multiple frames : Step 1: Design a frame with three... class MultipleFrame{ public static void main(String[] args){ JFrame f = new 

Java Beginners

please help me?
please help me?  Define a class named Circle with the following.... Set the default values of radius to 1 and the colour as red. A private static... of the Circle object. Use the constant PI value for the calculation. A public 

Advertisements Advertisements
 

 

 

DMCA.com