Re: Selbstdefinierte Datenklasse als Array



Thomas Adamek wrote:
Hallo,

ich habe ein Problem. Ich möchte eine selbstdefinierte Datenklasse,
z.B.
public class Adresse {
String vorname;
String nachname;
String strasse;
int plz;
}

als Array verwenden.

Du möchtest Instanzen dieser Klasse _in_ einem
Array ablegen. Bei deiner Formulierung müsste
Adresse die Klasse Array erweitern.

public static void main() {
Adresse[] adr = new Adresse[5];
adr[1].plz = 27711;
adr[1].vorname = "hans";
}

Schonmal das Wort Datenkapselung gehört?
Btw. ist es keine gute Idee, eine PLZ als
int zu definieren.

Wo ist denn mein Denkfehler?

Du versuchst zu programmieren, ohne Ahnung von den Basics
zu haben - lesen bildet.

Alfred
.



Relevant Pages

  • Help in French|Spanish|German translation.
    ... I am also an author of User-defined string functions. ... WORDTRANEX (cSearched, cArExpressionSought | cExpressionSough, ... each string of the array is searched ... If the parameter nArStartOccurrence is -1 or omitted, the replacement starts ...
    (microsoft.public.fox.helpwanted)
  • Re: passing a string to a dll
    ... Joe, I really appreciate you taking the time to demonstrate this. ... sure how I would implement indexing it for random alphanumeric codes. ... I might handle the array. ... I actually have been wondering if I could use a second string ...
    (microsoft.public.vc.mfc)
  • Re: passing a string to a dll
    ... I might handle the array. ... I actually have been wondering if I could use a second string ... look at insertion cost, organization cost, and search cost. ...
    (microsoft.public.vc.mfc)
  • Re: Array Type Mismatch
    ... Dim resultAs String ... I am still somewhat confused as to why nothing is stored in the array. ... Public Function TextBoxGetLine(....arguments... ...
    (microsoft.public.access.formscoding)
  • Help in Spanish translation of the description of UDFs
    ... functions of minimum / maximum values among elements of an array column. ... GETALLWORDS- Inserts the words from a string into a global dimensioned ... WORDTRAN- Searches a character string for occurrences of a first word, ... ARRAYSUM- Returns the sum of all or a specified range of numeric (and/or ...
    (microsoft.public.fox.helpwanted)