Total members 11895 |It is currently Thu Dec 26, 2024 4:59 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





hi i am new using eclipse and i was wondering if somebody knows how to
call a global variable that is declare in x class in a different class?




Author:
Proficient
User avatar Posts: 280
Have thanks: 1 time

What is even better is the bean pattern. Basically, all elements are
private and have getter/setter accessors. This is how Java and JSP work
together, for the most part. Example:

Code:
public class myBean {
private String myString = "";
private int myInt = 0;

public String getMyString () {
return myString;
}

public void setMyString (String myString) {
this.myString = myString;
}

public int getMyInt () {
return myInt;
}

public void setMyInt (int myInt) {
this.myInt = myInt;
}
}

Then, anyone on the outside can set or get the bean properties using the
method calls.

_________________
Please recommend my post if you found it helpful


Author:
Proficient
User avatar Posts: 228
Have thanks: 0 time
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : how to call a global variable?
 different between Local variable and Global variable     -  
 Accessing Global Variables with the global Statement     -  
 global statement in php     -  
 dynamic array as global variables     -  
 Page Call MySelf PHP     -  
 Call PHP code from JSP Page     -  
 Make a call using java     -  
 How i can transfer voice during call from phone to PC?     -  
 How i can transfer voice during call from phone to PC?     -  
 General call (Invoke) to method     -  



Topic Tags

Java Basics, Java Variables
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com