Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to resize an array using a boolean resize() method

843785Jan 25 2009 — edited Jan 25 2009
Hello,

Could anyone provide pointers as to how I would accomplish resizing an array using a boolean resize() method.

I believe the correct format for this would be. I am just unclear of how exactly what values and variables would need to be created.

public boolean resize(int newSize);
//returns true if successful (widening), false if narrowing

for ()
if()
break;

return false;
else
{
for()

return true;
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2009
Added on Jan 25 2009
3 comments
435 views