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.
Printable View
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.
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.
Java is even fond of saying that everything in Java is a class. So technically, everything in Java is a struct or type.Code:class MyClassIsAstructOrAtype{
int a;
String b;
ComplicatedObject c;
}
In short, every Java app or applet is a struct or type or new class. Notice the .class extension.