• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused with mock exam question

 
Ashish Agre
Ranch Hand
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was the Question Excercise9-1 : Want to know if(true) code = "Right; else code = "Wrong";
 
Javin Paul
Ranch Hand
Posts: 295
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi Ashish , Can you clarify your question , its not really clear why you are confused and your title and code doesn't relate together , can you please clearly state what problem you are facing and may be we can help you out.

Thanks
Javin
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashish, welcome to javaranch.

As Javin said, please specify your question more clearly. Don't put your whole question in the subject line, I've fixed the subject line for you...
 
Ashish Agre
Ranch Hand
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well this was he question in SCJP 6 book exccercise i just wanted to chk whether the solution i provided is roght or wrong
Q : Create a simple counting thread. It will count to 100, pausing one second between each number. Also, in keeping with the counting theme, it will output string every ten number.
 
Sunny Bhandari
Ranch Hand
Posts: 448
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only thing I notice is that you are pausing 1 second after every ten numbers and not after each number. Move Thread.sleep out of if(i%10) condition
 
Ashish Agre
Ranch Hand
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



will this work!!! seems that it is working?
 
Sunny Bhandari
Ranch Hand
Posts: 448
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will go with (Assuming no InterruptedException is going to occur)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic