Home Answers Viewqa Java-Beginners static functions

 
 


Praveen Kumar
static functions
11 Answer(s)      2 years ago
Posted in : Java Beginners

Give some brief defenition for
1. Static Variables
2. Static Functions
3. Instance Variable

View Answers

June 24, 2011 at 3:44 PM


Static Variables

Static variables are class variables that are shared by all instance of class ..

1)It is a variable which belongs to the class and not to object(instance).

2)Static variables are initialized only once , at the start of the execution . These variables will be initialized first, before the initialization of any instance variables.

3)A single copy to be shared by all instances of the class.

4)A static variable can be accessed directly by the class name and doesn�t need any object.

Static Methods

Static method is the method which belongs to the class and not to the object(instance).

1)A static method can access only static data. It can not access non-static data (instance variables).

2)A static method can call only other static methods and can not call a non-static method from it.

3)A static method can be accessed directly by the class name and doesn�t need any object.

4)A static method cannot refer to "this" or "super" keywords in anyway.

Instance Variables

An instance variable is a variable which is related to a single instance of a class. Each time an instance of a class is created, the system creates one copy of the instance variables related to that class.An instance variable is declared inside a class, but not within a method.

For more information, visit the following links:

Java Static Variables

Java Instance Variables

Java Static Method


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }


September 24, 2011 at 2:16 PM


class a{ static int a=1; static void display(){ System.out.println("it is static methode"+a); } } class main{ public static void main(string args[]){ a obj=new a();//can ,t requirement of it a.display(); //it is directly call by class name

} }









Related Pages:
static functions
static functions  Give some brief defenition for 1. Static Variables 2. Static Functions 3. Instance Variable  Static Variables Static...)It is a variable which belongs to the class and not to object(instance). 2)Static
Functions and Methods
Functions and Methods  Write a Java program to input the sides... { public static void decide(int side1,int side2,int side3){ String..."; System.out.println(type); } public static void main(String[] args
Functions and Methods
Functions and Methods  (1) Write a program in java to input 10... static void findCube(int num[]){ for(int i=0;i<num.length;i...])); } } public static void main(String args[]){ Scanner input=new
STRING FUNCTIONS
the following code: import java.util.*; class StringExample{ public static...) ); return buf.toString(); } public static void main(String[] args
Static Method in PHP - PHP
Static Method in PHP  So far I can easily use the normal functions as variable in PHP? but how can use static method?  Hi Friend, Please...-static-variable-method.html Thanks
Even and odd functions in java
Even and odd functions in java  Even and odd functions in java  ... static void main(String[] args) { Scanner input = new Scanner(System.in...); oddMethod(number); } public static void evenMethod(int n
Inverse of trigonometric functions in java.
Inverse of trigonometric functions in java.  How to get inverse of trigonometric functions in java?   public class InverseTrigno { public static void main(String[] args) { double degrees = 30; double
STATIC
STATIC  WHAT IS STATIC BLOCK?EXPLAIN , AND WHAT IS THE DIFFERENCE BETWEEN STATIC BLOCK AND STATIC METHOD?   A STATIC block is automatically... between static block and static method: static block will execute when ever
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,then go for static methods. If we want variables those values will not be changed
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 and accessed each time an instance of a class, an object, is created. When static
Static
Static  Can i know the real time example for Static method and final variables with defenition? Thank you
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
static
redeclare static variable in the inherited class  can we redeclare static variable in the inherited class like this: public class StaticClass1 { class StaticClass1{ static int noOfInstances; StaticClass1
Hibernate Aggregate Functions
Hibernate Aggregate Functions In this tutorial you will learn about aggregate functions in Hibernate In an aggregate functions values of columns... supports various useful Aggregate functions some of these are : avg(...), avg
How to Use Java Functions In EL
How to Use Java Functions In EL          To use a Java Functions in  EL we need three things. The java class with a static method. A Tag Library
greatest of 3 numbers using classes and functions.
greatest of 3 numbers using classes and functions.  WAP to calculate greatest of 3 numbers using classes and functions with parameters through input... FindLargest{ public static void main(String[] args){ int max = Integer.MIN
Program using String functions - Java Beginners
{ public static void main(String[] args) { int count = 0
What is functions?
What is functions?  Hi, Please tell me about PHP functions? Thanks in advance
What is functions?
What is functions?  Hi, Please tell me about PHP functions? Thanks in advance
Java reverse string without using inbuilt functions
Java reverse string without using inbuilt functions In this tutorial, you will learn how to reverse string without using any inbuilt functions. Here, we... { public static int getLength(String myString) { int i = 0; try { while (true
What is functions?
What is functions?  Hi, Please tell me about PHP functions? Thanks in advance.   About Functions: Functions in PHP is block of code... functions and use it multiple times. In PHP there is many pre-defined functions
Inbuild functions
Inbuild functions  List all the inbuild functions in java
static in java
static in java  what is the need to go static? what use
Static method
Static method  what is a static method?   Have a look at the following link: Java Static Method
static methods
static methods  why static methods cannot read or write the instance variables
static method
static method  Give some absolute examples and definition for static method also
Static
Static       Static... an instance of a class. Static methods are implicitly final method, since overriding depends on the type of the object, and static methods are attached to a class
static keyword
static keyword  please give some detail about Static keyword.   Static Variables Static variables are class variables that are shared... and not to object(instance). 2)Static variables are initialized only once , at the start
static keyword
static keyword  Hii, In which portion of memory static variables stored in java. Is it take memory at compile time? thanks deepak mishra
Static Variable
Static Variable  What is the basic use of introducing static variable type in java?Please explain clearly....   The Static means... of a class, an object, is created. When static is applied to member variables
how do i apply the javascript validation functions to the iframe content?
how do i apply the javascript validation functions to the iframe content?  Hi friends am Yogesh Nandane..Developing a small accessibility evaluation...=insideDocument.getElementsByTagName('div'); //static (divs won't
how do i apply the javascript validation functions to the iframe content?
how do i apply the javascript validation functions to the iframe content?  Hi friends am Yogesh Nandane..Developing a small accessibility evaluation...=insideDocument.getElementsByTagName('div'); //static (divs won't
PHP Functions, PHP Functions Tutorials
PHP Functions In this section we will understand important PHP functions with the help of example code. What is Functions? Function is a block of code...; } Functions in PHP PHP provides many built-in functions to do the real job
Boolean functions in JavaScript
Boolean functions in JavaScript  Explain about the Boolean functions present in Javascript
What are encryption functions in PHP?
What are encryption functions in PHP?  What are encryption functions in PHP
decodeURI() and encodeURI() functions in JavaScript
decodeURI() and encodeURI() functions in JavaScript  What are decodeURI() and encodeURI() functions in JavaScript
functions strstr() and stristr().
functions strstr() and stristr().  What is the functionality of the functions strstr() and stristr
the functions unlink and unset
the functions unlink and unset  What is the difference between the functions unlink and unset
demonstrate a) static data members b) static methods
demonstrate a) static data members b) static methods  demonstrate a) static data members b) static methods
Hibernate Criteria Aggregate Functions
Hibernate Criteria Aggregate Functions The Hibernate Criteria Aggregate...(). These functions are of Projections class. Following are the way to use...") public static void main(String[] args) { Session session
Boolean functions present in Javascript
Boolean functions present in Javascript   Explain about the Boolean functions present in Javascript
php stream functions
php stream functions  what does php stream functions do
JavaScript Variadic functions
JavaScript Variadic functions  Explain about Variadic functions
php array functions
php array functions  php array functions list
Static keyword in public static void main
Static keyword in public static void main  Hi, I have seen that on page mentioned below for static keyword explanation given is: Page: http...: static keyword indicates that this method can be invoked simply by using the name
What is Character Functions
What is Character Functions  What is Character Functions   Hi, Here is the answer, Character Functions are INITCAP, UPPER, LOWER, SUBSTR & LENGTH. Additional functions are GREATEST & LEAST. Group Functions
c-language pointer functions
c-language pointer functions  what is the execution process of character pointer functions with example
Confusion on Functions. Help Please?!
Confusion on Functions. Help Please?!  Write a program which has a number of functions for getting the area i.e. area of circle, area of square, area of rectangle and area of cylinder. Right, I've got some of it, but I'm just