passing data between two java classes with out creating instances

i have a class with some instance variables. i have another class that contains data that is to be assigned to the instance variables of the first class.

so i want to assign this data of second class to the instance variables of first class without creating instance of first class

is it possible

[316 byte] By [vijay_143a] at [2007-10-2 10:02:57]
# 1
myObject.setVariable(MySecondClass.myStatisField);
MartinHilperta at 2007-7-13 1:15:26 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...
# 2

> so i want to assign this data of second class to the

> instance variables of first class without creating

> instance of first class

> is it possible

You can not access "instance variables" without creating an instance. That's why they are called "instance variables." Assigning values to "instance variables" without an instance, does not make sense. You should explain what you are trying to accomplish and you will likely get a good solution.

You can create static variables and methods in the first class and assign values using them.

atmguya at 2007-7-13 1:15:26 > top of Java-index,Archived Forums,Java 2 Software Development Kit (J2SE SDK)...