Is there any to use Java's vector like User-type from VB, such as a vector of vectors?


New to Java from VB6

Is there any to use Java's vector like User-type from VB, such as a vector of vectors?

type var1
    string as String
    int1 as Interger
    single1 as single
end type

Anything in Java like this: I looked at multidimentional array but they are restricked to one variable type throughout the array.

I looked at vector method but there is no multi-dimentional version, is there?

Is there such a method as vector of vectors so that I can end up with the VB user-type variable?

Bill
HiddenattractorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sudhakar_koundinyaCommented:
Vector main=new Vector();

Vector integers=new Vector();
integers.add(new Integer(10));
integers.add(new Integer(100));
integers.add(new Integer(1000));


main.add(integers);

Vector strings=new Vector();

strings.add("Hello");
strings.add("hi");
main.add(strings);

Are u looking for some thing like this??
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sudhakar_koundinyaCommented:
Or are u expecting something like this??

class UserClass
{
      int i=100;
      String s="Hello";
      Double d=10.0;  
       UserClass(int i,String s,Double d)
       {
                this.i=i;
                this.s=s;
                this.d=d;
        }
}

Vector vect=new Vector();

vect.add(new UserClass(10,"Hello",9.0));
vect.add(new UserClass(100,"Hi",99.99));
0
krakatoaCommented:
Like SK illustrated, you are talking about a class here, which is Java's fundamental unit. You'd need to simmply build a class to match your VB UDT, and that class can then be treated like a Java object, and put inside a Vector, and that Vector itself put inside oher vectors and so on if needed.
0
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

sudhakar_koundinyaCommented:
May I know why you have accespted krakatoa's answer as he/she also supporting my idea??

0
krakatoaCommented:
Venabili:

It seems often as soon as I get involved in a question, some problem arises (reason why I don't get involved so often, actually).

I thought this -as you've said many times to me yourself - is not "about points"? Maybe the questioner (ho I am sure will answer for himself) just wants an explanation in plain English, rather than code? I would, personally.

But I don't think it's really ok for sudhakar to "put pressure" on the questioner (for which you have reprimanded *me* several times), to try to get points. There are plenty of times when I dont get points for questions that I "answered" first. Do we relaly need to go through this painful rigamarole again???
0
sudhakar_koundinyaCommented:
>>just wants an explanation in plain English, rather than code?
Friend, You just reframmed  my code in english, I believe.

>>But I don't think it's really ok for sudhakar to "put pressure" on the questioned
In such case I can't say thing to you friend.

>>There are plenty of times when I dont get points for questions that I "answered" first
Friend, this happens even to me, ofcouse to other experts also I believe. But how many times one should loose their points??.

>>Do we relaly need to go through this painful rigamarole again???
Friend, Sincerely I want to say, If this is not for points, you don't post that comments.(Honestly this applies even  me too )

Although all friends tries to help more or less to the questioners - Our friend's  first intentions it get the points only - Because all of us want to prove ourselves and this is True as per my belief.

And coming to reopening the question and accepting my question/splitting the points - I leave this to Hiddenattractor's decision.


Regards
Sudhakar
0
VenabiliCommented:
Guys,

CALM DOWN!

krakatoa,

O proposed split. Because you both did great work here:)
I had not reopen and I will not unless the Asker asks me - I am just explaining what should be done. But these are their points ;)

But - you  both put a lot of work here and as I said both answers are great...

>>reason why I don't get involved so often, actually
And we miss you  :)

sudhakar ,

OK... I missed your comment.:( No pressure in the future question - post for me in my thread and let me do the explanations and so on:) Better than annoying the fellow-experts ;)

Venabili
0
sudhakar_koundinyaCommented:
Vanabili,

OK..

I will do not put pressure on questioners, if I face similar problems in future participations.

Regards
Sudhakar

0
krakatoaCommented:
I just feel that it's best to roll with the punches as they say. I agree with Venabili that there has to be some usual way of awarding points, but at the end of the day it's the questioner who is the customer, and unless an answer is awarded which is completely wrong, then, in the end, things even themselves out in the long run, and experts like sudhakar will pick up more points than someone like me, and I don't have a problem with that. ;)
0
VenabiliCommented:
Question reopened per request in feedback

krakatoa,

No personal isues. The idea is not who takes the points but when someone click on "View Solution" to see the solution(code+explanation in our case)

Hiddenattractor,
Read the help page. They are written for this - to explain to the users how the site works and what should be cloicked when:)

Venabili
0
krakatoaCommented:
That's ok. It just means that if I do happen to have a good answer, I will think twice about offering it, as this is again  a waste of time.
0
VenabiliCommented:
Are you claiming that only you deserve points here?
0
krakatoaCommented:
:( I'm saying the questioner made the choice and now his decision has been questioned - and that's all I have to say.
0
VenabiliCommented:
krakatoa,

Sometimes the Askers has no idea that they can split points. Does this mean that we should leave the things as they are?
And this particular asker said that he had made mistake...

If i see something like this happen- i react - no matter which are the experts... That is what I am supposed to do

Venabili
0
krakatoaCommented:
Yeah ... I've got something to add venabili:

The questioner asked specifically about "vector(s) of vectors". I was the first and only one to deal with that specific side of the question, so I don't wonder that all the points were originally awarded to me - which I think is where they belong.
0
sudhakar_koundinyaCommented:
>> I was the first and only one to deal with that specific side of the question

My first comment already gave that answer vector integers and strings where integers and strings are individual vectors

regards
sudhakar
0
krakatoaCommented:
Obviously if the asker is not familiar with Java, it isn't very likely that he'd understand your code, if he is asking the question in the first place is it? Your code doesn't explain what's going on unless you are already familiar with Java.
0
sudhakar_koundinyaCommented:
rephrasing
My first comment already gave that answer main vector holds  integers and strings where integers and strings are individual vectors


And my second comment says main vector holds the individual class units where class holds the integer, string and other data varaibles.

conceptually speaking class can also be treated as vector as it can hold multiple objects. Only thing that i may /may not do is working like Java Vector class


Hence, my both comments are correct as per the question


Regards
Sudhakar
0
sudhakar_koundinyaCommented:
>>Your code doesn't explain what's going on unless you are already familiar with Java.


In his  first comments only questioner said that he is looking at Vector but thinking of multi dimensional array. So there is no question to be araised that he don't know abt that class

Regards
Sudhakar
0
krakatoaCommented:
:D
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.