• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Byte Operation

 
Saravana Ranch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got a integer string of size 10 (initialized with 0 )then I want to add a number with this string which is preceded with zero (0), using byte operation is it possible.
Example : a[10] which is initialized with zero.
I want to add 123 in this then result should be like this.
0000000123. ( Using byte operation. ).

The size of the array is the user's input.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like homework, in which case you'll need to show us what you have done first. We're happy to help, but we prefer to help people learn rather than hand out answers.

Either way, I'm moving this to the Java in General (beginner) forum.

Dave
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Saravana Ranch:
I got a integer string of size 10 (initialized with 0 )then I want to add a number with this string which is preceded with zero (0), using byte operation is it possible.
Example : a[10] which is initialized with zero.
I want to add 123 in this then result should be like this.
0000000123. ( Using byte operation. ).

The size of the array is the user's input.


What do you mean by "integer string"? This is not common terminology in Java. As noted above, you need to show us what you have tried already. We will be glad to help you from there. For future posts, you should also look at our suggestions about How to Ask a Question.

Layne
 
Saravana Ranch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Layne Lund:


What do you mean by "integer string"? This is not common terminology in Java. As noted above, you need to show us what you have tried already. We will be glad to help you from there. For future posts, you should also look at our suggestions about How to Ask a Question.

Layne


----

An Array which hold integer value. The size of the array should be depends on user.
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your code?
 
Saravana Ranch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marilyn de Queiroz:
Where is your code?


You have to say that!...
I am asking your idea.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Saravana Ranch:

You have to say that!...
I am asking your idea.


And we're asking you to show us what you have so far.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Saravana Ranch:


You have to say that!...
I am asking your idea.


Please see the link that I gave above. In their own way, Marilyn and Ernest are asking for more information from you. Please show us what you have done so far. If you haven't written any code yet, that's fine. In fact, I strongly encourage you to use English (or your own native language) to explain the steps you will take to solve this problem. Tell us what your own ideas are and we'll be glad to help with any specific problems that you are stumped on.

Good luck and keep coding!

Layne
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe something like this??

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic