|
-
Dec 6th, 2000, 04:49 PM
#1
Thread Starter
Addicted Member
Can i create a Struct or a type in Java, like in C/C++
Struct{
... ...
... ...
... ...
};?
or in VB
Type
...
...
...
End type?
I need to do that to put it in a random file.
thanks.
-
Dec 6th, 2000, 08:19 PM
#2
Objects are an advanced evolution of Struct / Type.
An object is an instance of a class.
Classes are types so to speak. Data Types, but much more. Also they are struct(ures) so to speak.
A class without methods (functions), only attributes (member variables) is what you seek.
Code:
class MyClassIsAstructOrAtype{
int a;
String b;
ComplicatedObject c;
}
Java is even fond of saying that everything in Java is a class. So technically, everything in Java is a struct or type.
In short, every Java app or applet is a struct or type or new class. Notice the .class extension.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|