Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


Explain Global variables in Packages?

Answers were Sorted based on User's Feedback



Explain Global variables in Packages?..

Answer / milind

i think der is no such thing global variable in java....
instance variable
local vaiable is in java

Is This Answer Correct ?    0 Yes 0 No

Explain Global variables in Packages?..

Answer / preetesh

There is no term as Global variable in Java.
Types of variable: 1) Local Variable declared within method.
2) Instance Variable declared within class but outside
method.
3) Class Variable
4) Parameters are also treated as variables

Example:
--------
public class Global {
public static int i = 25;
public static String s = "Preetesh";
}

//Such members can be accessed as:

public class Test {
public static void main(String[] args)
{
Global.i = Global.i + 100;
Global.s = "Java";
}
}

Is This Answer Correct ?    0 Yes 0 No

Explain Global variables in Packages?..

Answer / therathna

for what package r u asking

there is no meaning for Global variables in Packages

Is This Answer Correct ?    0 Yes 1 No

Explain Global variables in Packages?..

Answer / anitha

expect private,all public,protected and default variables
are global in a package

Is This Answer Correct ?    0 Yes 1 No

Post New Answer



More Core Java Interview Questions

Which class should you use to obtain design information about an object in java programming?

0 Answers  


What is a double?

0 Answers  


Differentiate between nested and inner class in java.

0 Answers   Akamai Technologies,


Tell me the Importent classes in net package?

0 Answers  


Can we override private method in java?

0 Answers  






Can we increase size of array?

0 Answers  


After compilation of java program we'll get .class code. If it's generated in OS Windows XP will it work on OS Linux? If yes why? If no why?

5 Answers   Aricent,


Which class contains a method: cloneable or object?

0 Answers  


How the threads are synchronized?

2 Answers   BMC, CTS,


what's diff between struts 1.1 & 1.2

3 Answers   Wipro,


primitive data types in Java ?

3 Answers  


what is java

3 Answers   Tech Mahindra,






Categories