Im from php, so i want to lear java. In php in a for loop if i want to create an array i just do
$items = $this->getItems();
for($i=0;$i<count($items);$i++)
{
$myarrayitems[$i] = $items[$i];
}
return $myarrayitems;
But in java i got arrayoutofexponsion or like that.
here is the code im trying
public String[] getItems(String url) throws Exception
{
URL rss = new URL(url);
Feed feed = FeedParser.parse(rss);
int items = feed.getItemCount();
int a = 0;
for (int i = 0; i < items; i++)
{
FeedItem item = feed.getItem(i);
String title[i] = item.getTitle();
}
return title;
}
How can i return title as array an make an var_dump of that?