Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22734

Re: hello here is a copy of a copy program on the net .

Newsgroups comp.lang.java.programmer
Date 2013-03-05 15:50 -0800
References <026b0609-ef87-470e-b899-fc00529bb4ce@googlegroups.com> <629a4687-24e7-49cc-b8b0-e7f91fbf79bd@googlegroups.com>
Message-ID <c0a27d29-f02b-460f-bf22-e1fe7c15ef43@googlegroups.com> (permalink)
Subject Re: hello here is a copy of a copy program on the net .
From Lew <lewbloch@gmail.com>

Show all headers | View raw


giovann...@ wrote:
> thank you
> display is just a control to see if read
> but if I wanted to see how hexaa instead of decimal?
> And how to change the value read
> for example by inverting the value?
> 
> b [i] = - (b [i]);

http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#format(java.lang.String, java.lang.Object...)
http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax
http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html

String rep = "";
for ( byte by : b )
{
  rep += String.format( "%2.2x ", by);
}

b [i] = - (b [i]);
is a perfectly valid expression. It has gotchas; the right-hand side is evaluated as an 'int' 
and undergoes a narrowing conversion on the assignment.

--
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

hello here is a copy of a copy program on the net . giovannich1965@gmail.com - 2013-03-05 08:44 -0800
  Re: hello here is a copy of a copy program on the net . "John B. Matthews" <nospam@nospam.invalid> - 2013-03-05 11:56 -0500
  Re: hello here is a copy of a copy program on the net . Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-03-05 12:01 -0500
  Re: hello here is a copy of a copy program on the net . giovannich1965@gmail.com - 2013-03-05 11:20 -0800
    Re: hello here is a copy of a copy program on the net . Lew <lewbloch@gmail.com> - 2013-03-05 15:50 -0800
  Re: hello here is a copy of a copy program on the net . giovannich1965@gmail.com - 2013-03-05 11:21 -0800
  Re: hello here is a copy of a copy program on the net . giovannich1965@gmail.com - 2013-03-06 12:40 -0800

csiph-web