T
Tanveer
In C++, it is always possible to have one class nested inside other or
for that matter, a data structure nested inside other data structure.
Something like:
class A
{
public:
struct A1
{
char a[10];
char b[10];
} a1;
struct A2
{
char a2[10];
char b2[10];
} a2;
...........
};
What i am struggling with is, i am searching for similar representation
for a java class.
I tried doing it as:
public class Temp
{
class A1
{
public String a1;
public String b1;
};
class A2
{
public String a2;
public String b2;
};
..............
};
This gets compiled but what i see is n no. of .java files get generated
named:
Temp.java
Temp$A1.java
Temp$A2.java
This behavior is coming as a surprise package to me.
I agree i dont't know much of java and am a begineer in this.
for that matter, a data structure nested inside other data structure.
Something like:
class A
{
public:
struct A1
{
char a[10];
char b[10];
} a1;
struct A2
{
char a2[10];
char b2[10];
} a2;
...........
};
What i am struggling with is, i am searching for similar representation
for a java class.
I tried doing it as:
public class Temp
{
class A1
{
public String a1;
public String b1;
};
class A2
{
public String a2;
public String b2;
};
..............
};
This gets compiled but what i see is n no. of .java files get generated
named:
Temp.java
Temp$A1.java
Temp$A2.java
This behavior is coming as a surprise package to me.
I agree i dont't know much of java and am a begineer in this.