We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › unexpected token: void
Page Index Toggle Pages: 1
unexpected token: void? (Read 488 times)
unexpected token: void?
Nov 18th, 2009, 11:21am
 
why is the return variable void in the setup considered an unexpected token?

btw: Disc is another class, I don't think it's the issue so I won't flood the forum with it's code  Tongue

 Disc disc1=new Disc(800,300,100);
 Disc disc2=new Disc(800,300,100);
 Disc disc3=new Disc(800,300,100);
 Disc disc4=new Disc(800,300,100);
 Disc disc5=new Disc(800,300,100);
 Disc disc6=new Disc(800,300,100);
 Disc disc7=new Disc(800,300,100);
 Disc disc8=new Disc(800,300,100);
 int level=1;
 Stack<Disc> fst;
 Stack<Disc> snd;
 Stack<Disc> trd;
 
 void setup() {
   size(1000,1000);
   Stack<Disc> fst=new Stack<Disc>();
   Stack<Disc> snd=new Stack<Disc>();
   Stack<Disc> trd=new Stack<Disc>();
 }
 
 void draw()
 {
   background(255);
   disc1.display();
   disc2.display();
   disc3.display();
   disc4.display();
 }
   boolean canMove(Stack a, Stack b)
   {
     int thisone=0;
     int thatone=0;
     if(!a.isEmpty())
     {
        thisone=a.peek().getSize();
        thatone=a.peek().getSize();
        if(thisone>thatone)
        {
          return false;
        }
        return true;
     }
   }
Re: unexpected token: void?
Reply #1 - Nov 18th, 2009, 12:24pm
 
Because you cannot yet use Java 1.5 syntax in Processing. So no Stack<Disk>, just Stack.
Page Index Toggle Pages: 1