The Artima Developer Community
Sponsored Link

Java Answers Forum
Simple Array Prob

1 reply on 1 page. Most recent reply: May 12, 2003 7:22 PM by Kishori Sharan

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Kris K

Posts: 6
Nickname: krisk
Registered: Apr, 2003

Simple Array Prob Posted: May 12, 2003 4:50 PM
Reply to this message Reply
Advertisement
char [] alphabet = new char [3];
alphabet[] = {'a','b','c'};
for(int x=0;x<3;x++)
{
System.out.print(alphabet[x]);
}

any ideas why this doesnt work?


Kishori Sharan

Posts: 211
Nickname: kishori
Registered: Feb, 2002

Re: Simple Array Prob Posted: May 12, 2003 7:22 PM
Reply to this message Reply
Change it to:
//char [] alphabet = new char [3];
char[] alphabet = {'a','b','c'};
for(int x=0;x<3;x++)
{
System.out.print(alphabet[x]);
}

Flat View: This topic has 1 reply on 1 page
Topic: JSP Previous Topic   Next Topic Topic: queue program using interface

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use