Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Explain about global variables in Java?

Answer Posted / satish

Direct global variables are not possible like

int i=0;
class{
....
....
}

But other way is create a class with static variables and
you can use it wherever needed.

class Global{
public static int i;
public static String s="";
}

class SomeClass{
public static void main(String args[]){
Global.i=23;
Global.s="Whats up"
}
}

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the process as to how substring() methodology mechanisms in java.

1111


What is a line break?

1024


How do you remove duplicates from an array in java?

945


What is 16 bits called?

938


Differece between class and generic class?

1024


What is keyword and identifier?

1126


How many bytes is a url?

974


Is string a class in java?

971


What is charat java?

948


Explain the Propertie sof class?

1044


What is pre increment and post increment in java?

979


What is difference between call by value and call by reference?

991


Why we override equals() method?

1029


What does this mean java?

1095


What is the main difference between java platform and other platforms?

1085