I'm trying to get more familiar with object arrays in Java and one thing I was attempting to do that is failing is declaring an object array on one line and then initializing it on a later line. Is this possible? Am I making a format mistake or just trying to do something I can't?
tl:dr; can a Java object array do something like this, below?
int[] s;
s = new int[]{ and put the list here..}
edit: adding my current code and error example
public class noncombatSKILLS {
noncombatSKILLS ( String receivName , String receivDescription , int receivDamage )
{
name = receivName ;
description = receivDescription ;
damage = receivDamage ;
!
!
public class CHARACTER {
noncombatSKILLS[] noncombat;
noncombat[] = { new noncombatSKILLS( "Scavenge" , "find some parts" , 123 ) } ;
this compiles correctly with just the declaration line under the CHARACTER class, but when I try to compile with the line added after it, I get 'error: not a statement' pointing the brackets following the 'noncombat'