Sunday, March 2, 2014

How to declare the corresponding C # int data type in Java?, DateTime?


I have a WebService returned data objects in C # for the
 
public class User
{
? public int Age {get; set;}
? public DateTime birth {get; set;}
}

How to declare the corresponding JavaBean that it?
I am now the only way, then in the process of determining
 
public class User
{
private object age = null;
private object birth = null
...
...
}

Should be how to write it?

Thank you<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
public class User
{
private int age;
private String birth;
}

web service can pass over something as string processing
Reply:
corresponding java objects inside were int and Date
public class User
{
private int age;
private Date birth;
...
...
}
Reply:
RE upstairs two
My C # which is int? And DateTime?
int? values ​​as int and null
DateTime? Values ​​to DateTime and null

If the declaration int in Java and DateTime words,
When the transfer is null, then over how to deal with?

Thank you
Reply:
LZ very puzzled why there int? Needs, datetime? Normal. I do not know where ye java null value type defined types, but the feeling is certainly not in the definition of a object, it feels too far-fetched, at least can be defined as string Well, at least it is null string can.
Reply:
RE: Upstairs
That
C # class above meIn JAVA how to define it?
They defined a String?
Well do not feel

No comments:

Post a Comment