Quantcast
Channel: Get Items Feeds4J Java Array - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Get Items Feeds4J Java Array

$
0
0

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?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images