Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Initialize class level constant integer with negative values

Former Member
0 Likes
701

Hi,

While initializing constant integer with -1, the actual value while calling the setter with this value is set to 1-

Even in the debugger when i view the value its 1-

Has anybody come across similar proglem? Any help?

Thanks,

Piyush

4 REPLIES 4
Read only

Former Member
0 Likes
620

There will be no issue due to this , as it will always be considered as -1.

It is just representation inside the system.

Read only

0 Likes
620

Hi Piyush,

No problem. This is an internal system representation. The value would be -1 only. You may need to check how it shows in your output.

Read only

Former Member
0 Likes
620

Hi,

Thanks for the reply.

The problem is i'm creating a XML out of this constant and when this value is assigned to a string, the string value is represented as "1-" and further with this value the XML is created.

Can i try something else here?

Thanks,

Piyush

Read only

Former Member
0 Likes
620

The class level constant is defined with data type "i", is it correct?

Do i need to change this if i have to assign value -1.