Article View: borland.public.jbuilder.java.language
Article #18741Re: Printing Arrays!! No. 2
From: Rob C
Date: Fri, 08 May 1998 00:00
Date: Fri, 08 May 1998 00:00
49 lines
1459 bytes
1459 bytes
sorry David Orriss
posted the wrong code
String roc = "Rocker"
should read
char roc[] = {'R', 'o', 'c', 'k', 'e', 'r'};
__________________________________________
class PrintString {
public static void main(String args[]) {
char roc[] = {'R', 'o', 'c', 'k', 'e', 'r'};
for (int i = 0; i < roc.length(); i++)
System.out.println(roc.substring( 0, i));
}
}
__________________________________________
with the desired effect bellow being printed to the
Execuion Log
R
Ro
Roc
Rock
Rocke
Rocker
I keep getting this error
Error: (0) initialization error: neither class nor source found for
java.lang.Odject
I tried to import that the above class, still get the wrong error. I'm
working through
the examples in "Borland Learn Java In 14 Days" and I was just trying to
experiment
with the Arrays and Conditional Loops.
am I breaking any assignment laws for the "roc" variable???
thanx in Advance
Rob
Technical Details
Message-ID:
<6iuar5$u014@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<6itei3$u01@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,4c54a2bc3cc4521f X-Google-Attributes: gidf74b3,public From: "Rob C" <rocker@netline.net.au> Subject: Re: Printing Arrays!! No. 2 Date: 1998/05/08 Message-ID: <6iuar5$u014@forums.borland.com> X-Deja-AN: 351353631 References: <6itei3$u01@forums.borland.com> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language