1 Replies - 755 Views - Last Post: 09 June 2011 - 02:36 PM

#1 iSimply   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 17
  • Joined: 29-May 11

"structs" in midlets

Posted 09 June 2011 - 02:25 PM


I have been roaming and combing various websites and forums, to find a way to make a struct in java. Now the reason I wanted a struct was, I remember reading that you really want to minimise the amount of classes in your midlet. I think it had to do with saving memory.

I would just like to know if tis is a valid comment, and if so, how would I go about making a struct in java without creating a class.

The struct I want is quite basic, it s an equation with 2 numbers, an arithmatic operator, and an answer. And I want to creat an array list of these.

Is This A Good Question/Topic? 0
  • +

Replies To: "structs" in midlets

#2 macosxnerd101   User is online

  • Games, Graphs, and Auctions
  • member icon

Reputation: 12316
  • View blog
  • Posts: 45,416
  • Joined: 27-December 08

Re: "structs" in midlets

Posted 09 June 2011 - 02:36 PM

Moved to Mobile Development since this is a Java ME question.

There is no such thing as a struct in Java. That's a C/C++ thing. On the mobile platform, you don't want memory intensive operations. Using multiple classes isn't a big deal, but don't create a ton of objects if you can avoid it.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1