• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Java help - adding int to integer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java help - adding int to integer


  • Subject: Re: Java help - adding int to integer
  • From: Dirk Bajohr <email@hidden>
  • Date: Sat, 11 Sep 2004 16:06:55 +0200

Hi Amorya,

Try this:
Integer lastChapter = (Integer)foreachFic.valueForKeyPath("email@hiddenr");
Integer nextChapter = new Integer(lastChapter.intValue() + 1);
nextPage.chapterToEdit.setNumber(nextChapter);


You can't use the operator "+" on objects. First you have to create int's or use the Integer.add() method.

Cheers,
Dirk


Am 11.09.2004 um 14:50 schrieb Amorya North:

My statement:

nextPage.chapterToEdit.setNumber(((Integer)(foreachFic.valueForKeyPath( "
email@hiddenr"))+1));



The error is: "Operator + cannot be applied to java.lang.Integer, int"


If I make the 1 into an Integer, it says the same but "java.lang.Integer, java.lang.Integer"


Is it 'cos I have a key called number? or am I making some crazy java error?


Amorya
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.



--
Dirk Bajohr
iSOLUTION - Individuelle Software fuer moderne Kommunikation

Hauptstr. 50
53757 Sankt Augustin

T +49 2241 921567-0
F +49 2241 921567-89
http://www.isolution.de
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Java help - adding int to integer (From: Amorya North <email@hidden>)

  • Prev by Date: Java help - adding int to integer
  • Next by Date: Re: Web form to Email only application?
  • Previous by thread: Java help - adding int to integer
  • Next by thread: (newbie)saving many-to-many relationship
  • Index(es):
    • Date
    • Thread