<< Chapter < Page Chapter >> Page >

Back to Question 37

Answer 36

Listing 5 . Listing for Answer 36.
/*File SampProg07.java from module 22 Copyright 1997, R.G.BaldwinWithout reviewing the following solution, write a Java application that clearly illustrates the difference betweenthe prefix and the postfix versions of the increment operator.Provide a termination message that displays your name. *********************************************************/class SampProg07{ static public void main(String[]args){ int x = 3;int y = 3; int z = 10;System.out.println("Prefix version gives " + (z + ++x));System.out.println("Postfix version gives " + (z + y++));System.out.println("Terminating, Dick Baldwin"); }//end main}//end class SampProg07

Back to Question 36

Answer 35

Java supports the following list of shortcut assignment operators. These operators allow you to perform an assignment and another operation with asingle operator.

+= -=*= /=%=&= |=^=<<=>>=>>>=

For example, the two statements that follow perform the same operation.

  • x += y;
  • x = x + y;

The behavior of each of the shortcut assignment operators follows this same pattern.

Back to Question 35

Answer 34


Back to Question 34

Answer 33

The assignment operator is a binary operator.

Back to Question 33

Answer 32


Back to Question 32

Answer 31

The answer for the bitwise exclusive or is:

  • 11 1 xor 1 produces 0
  • 10 1 xor 0 produces 1
  • 01 0 xor 1 produces 1
  • 00 0 xor 0 produces 0

Back to Question 31

Answer 30

The answer for the bitwise inclusive or is:

  • 11 1 or 1 produces 1
  • 10 1 or 0 produces 1
  • 01 0 or 1 produces 1
  • 00 0 or 0 produces 0

Back to Question 30

Answer 29

The answer for the bitwise and is:

  • 11 1 and 1 produces 1
  • 10 1 and 0 produces 0
  • 01 0 and 1 produces 0
  • 00 0 and 0 produces 0

Back to Question 29

Answer 28

True: Bits shifted off the right end are lost.

Back to Question 28

Answer 27

False: In Java, the signed right shift operation populates the vacated bits with the sign bit, while the left shift and the unsigned right shift populate the vacated bits with zeros.

Back to Question 27

Answer 26

The following table shows the seven bitwise operators supported by Java.

Bitwise operators Operator Typical Use Operation>>OpLeft>>Dist Shift bits of OpLeft right by Dist bits (signed)<<OpLeft<<Dist Shift bits of OpLeft left by Dist bits>>>OpLeft>>>Dist Shift bits of OpLeft right by Dist bits (unsigned)&OpLeft&OpRight Bitwise and of the two operands| OpLeft | OpRight Bitwise

Back to Question 26

Answer 25

The bitwise and operator and the bitwise inclusive or operator are shown below.

Two bitwise operators &bitwise and | bitwise inclusive or

Back to Question 25

Answer 24

An important characteristic of the behavior of the logical and operator and the logical or operator in Java is that the expressions containing them are evaluated from left to right. The evaluation of the expression is. terminated as soon as the result of evaluatingthe expression can be determined. For example, in the expression given in Question 24 , if the variable a is less than the variable b , there is no need to evaluate the right operand of the || operator to determine the value of the entire expression. Therefore, evaluation will terminate as soon as it isdetermined that a is less than b .

Questions & Answers

How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
scanning tunneling microscope
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
The nanotechnology is as new science, to scale nanometric
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
sciencedirect big data base
Introduction about quantum dots in nanotechnology
Praveena Reply
what does nano mean?
Anassong Reply
nano basically means 10^(-9). nanometer is a unit to measure length.
do you think it's worthwhile in the long term to study the effects and possibilities of nanotechnology on viral treatment?
Damian Reply
absolutely yes
how to know photocatalytic properties of tio2 nanoparticles...what to do now
Akash Reply
it is a goid question and i want to know the answer as well
characteristics of micro business
for teaching engĺish at school how nano technology help us
How can I make nanorobot?
Do somebody tell me a best nano engineering book for beginners?
s. Reply
there is no specific books for beginners but there is book called principle of nanotechnology
how can I make nanorobot?
what is fullerene does it is used to make bukky balls
Devang Reply
are you nano engineer ?
fullerene is a bucky ball aka Carbon 60 molecule. It was name by the architect Fuller. He design the geodesic dome. it resembles a soccer ball.
what is the actual application of fullerenes nowadays?
That is a great question Damian. best way to answer that question is to Google it. there are hundreds of applications for buck minister fullerenes, from medical to aerospace. you can also find plenty of research papers that will give you great detail on the potential applications of fullerenes.
what is the Synthesis, properties,and applications of carbon nano chemistry
Abhijith Reply
Mostly, they use nano carbon for electronics and for materials to be strengthened.
is Bucky paper clear?
carbon nanotubes has various application in fuel cells membrane, current research on cancer drug,and in electronics MEMS and NEMS etc
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Object-oriented programming (oop) with java. OpenStax CNX. Jun 29, 2016 Download for free at https://legacy.cnx.org/content/col11441/1.201
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?