Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2008, 09:51 PM
Member
 
Join Date: Oct 2008
Posts: 7
Rep Power: 0
thagentleman is on a distinguished road
Send a message via AIM to thagentleman
Default Structs Question
Does anyone know how to initialize and declare variables using structs??

Thanks in advance
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 10-12-2008, 10:03 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 6,431
Rep Power: 8
Fubarable is on a distinguished road
Default
Are we talking C++ or are we talking Java here??
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 10-12-2008, 10:05 PM
Member
 
Join Date: Oct 2008
Posts: 7
Rep Power: 0
thagentleman is on a distinguished road
Send a message via AIM to thagentleman
Default
preferably Java.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 10-12-2008, 10:08 PM
Member
 
Join Date: Oct 2008
Location: UK
Posts: 48
Rep Power: 0
Paul Richards is on a distinguished road
Default
Java does not have structs, so you use classes instead.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 10-12-2008, 10:09 PM
Fubarable's Avatar
Moderator
 
Join Date: Jun 2008
Posts: 6,431
Rep Power: 8
Fubarable is on a distinguished road
Default
Well then of course you know that Java doesn't have structs. So the short answer is "you can't". The long answer will depend on you restating your question in greater detail mainly concentrating on what your ultimate goal with the code is.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 10-12-2008, 10:18 PM
CJSLMAN's Avatar
Moderator
 
Join Date: Oct 2008
Location: Mexico
Posts: 1,159
Rep Power: 3
CJSLMAN is on a distinguished road
Default No pointers, struct, or union in Java
As far as I know, struct don't exist in Java. Found the following which might help (shows struct equivalent using classes):
C Data Types Not Supported By the Java Language
__________________
Chris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

Last edited by CJSLMAN; 10-12-2008 at 10:36 PM.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question mark colon operator question orchid Advanced Java 8 11-27-2008 07:36 AM
question zizou147 New To Java 13 07-04-2008 08:05 PM
question on jsp munigantipraveen JavaServer Pages (JSP) and JSTL 2 06-30-2008 03:47 PM
Need help on this question Deon New To Java 3 01-27-2008 04:58 PM
question about rmi leonard New To Java 1 08-06-2007 05:19 AM


All times are GMT +2. The time now is 11:01 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org