<< Chapter < Page Chapter >> Page >

Answer and Explanation

Question 11

What output is produced by the program shown in Listing 11 ?

  • A. Compiler Error
  • B. Runtime Error
  • C. 0 1 2 3 4
  • D. 1 2 3 4 5
  • E. None of the above
Listing 11 . Listing for Question 11.
public class Ap035{ public static void main(String args[]){new Worker().doLoop(); }//end main()}//end class definition class Worker{public void doLoop(){ int cnt = 0;while(cnt<5){ cnt++;System.out.print(cnt + " "); cnt++;}//end while loop System.out.println("");}//end doLoop() }//end class definition

Answer and Explanation

Question 12

What output is produced by the program shown in Listing 12 ?

  • A. Compiler Error
  • B. Runtime Error
  • C. 0 1 2 3 4 5
  • D. 1 2 3 4 5 5
  • E. None of the above
Listing 12 . Listing for Question 12.
public class Ap036{ public static void main(String args[]){new Worker().doLoop(); }//end main()}//end class definition class Worker{public void doLoop(){ int cnt;for(cnt = 0; cnt<5; cnt++){ System.out.print(cnt + " ");}//end for loop System.out.println(cnt + " ");}//end doLoop() }//end class definition

Answer and Explanation

Question 13

What output is produced by the program shown in Listing 13 ?

  • A. Compiler Error
  • B. Runtime Error
  • C. 0 1 2 3 4 5
  • D. 1 2 3 4 5 5
  • E. None of the above
Listing 13 . Listing for Question 13.
public class Ap037{ public static void main(String args[]){new Worker().doLoop(); }//end main()}//end class definition class Worker{public void doLoop(){ for(int cnt = 0; cnt<5; cnt++){ System.out.print(cnt + " ");}//end for loop System.out.println(cnt + " ");}//end doLoop() }//end class definition

Answer and Explanation

Question 14

What output is produced by the program shown in Listing 14 ?

  • A. Compiler Error
  • B. Runtime Error
  • C. 0 1 2 3 3
  • D. 0 1 2 3 4
  • E. None of the above
Listing 14 . Listing for Question 14.
public class Ap037{ public static void main(String args[]){new Worker().doLoop(); }//end main()}//end class definition class Worker{public double doLoop(){ for(int cnt = 0; cnt<5; cnt++){ System.out.print(cnt + " ");if(cnt == 3){ System.out.println(cnt);return cnt; }//end if}//end for loop //return 3.5;}//end doLoop() }//end class definition

Answer and Explanation

Question 15

What output is produced by the program shown in Listing 15 ?

  • A. Compiler Error
  • B. Runtime Error
  • C. 0 1 2 3 3
  • D. 0 1 2 3 4
  • E. None of the above
Listing 15 . Listing for Question 15.
public class Ap038{ public static void main(String args[]){new Worker().doLoop(); }//end main()}//end class definition class Worker{public void doLoop(){ for(int cnt = 0; cnt<5; cnt++){ System.out.print(cnt + " ");if(cnt == 3){ System.out.println(cnt);return; }//end if}//end for loop }//end doLoop()}//end class definition

Answer and Explanation

Listings

I recommend that you open another copy of this document in a separate browser window and use the following links to easilyfind and view the listings while you are reading about them.

Questions & Answers

how can chip be made from sand
Eke Reply
are nano particles real
Missy Reply
yeah
Joseph
Hello, if I study Physics teacher in bachelor, can I study Nanotechnology in master?
Lale Reply
no can't
Lohitha
where we get a research paper on Nano chemistry....?
Maira Reply
nanopartical of organic/inorganic / physical chemistry , pdf / thesis / review
Ali
what are the products of Nano chemistry?
Maira Reply
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
Google
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
hey
Giriraj
Preparation and Applications of Nanomaterial for Drug Delivery
Hafiz Reply
revolt
da
Application of nanotechnology in medicine
has a lot of application modern world
Kamaluddeen
yes
narayan
what is variations in raman spectra for nanomaterials
Jyoti Reply
ya I also want to know the raman spectra
Bhagvanji
I only see partial conversation and what's the question here!
Crow Reply
what about nanotechnology for water purification
RAW Reply
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
what is the stm
Brian Reply
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
LITNING Reply
what is a peer
LITNING Reply
What is meant by 'nano scale'?
LITNING Reply
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
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
Good
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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?

Ask