• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Vectors from class to class

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to java. I have a situation at work where I need to reference objects in a class (I'll call it ClassB) that I am developing. There is another class (classA) that someone 'IS PLANNING' to write. The problem is that I don't know exactly how it will be written so I have to simulate a situation where I connect to the objects in classA. I am using a new tool that requires that I 'register' the objects via Vectors. If classA has Vectors for it's attributes can I directly reference that Vectors by way of instantiating the class and using the reference variable? Keep in mind that classA will instantiate my classB.
For ecxample:
class ClassA{
Vector vector1 = new Vector;
public whatever(){
vector1.addElement("syntax= mysyntax");}
main(){
ClassB B = new ClassB;
ClassB.loader();
}//main
}

class ClassB{
//??? how can I access the objects?
}
 
reply
    Bookmark Topic Watch Topic
  • New Topic