Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

problem with my code

  Asked By: BERTO    Date: Nov 13    Category: Java    Views: 497
  

Hi

After reading some java tutoria by myself, I found this excersice and I tried to resolve it, but I don't kow what I did wrong, can you help me to resolve it. This is the code I wrote:

public class FixDebugSix2
{
public static void main(String args[])
{
char letter;
int d;
final int MIN = 25;
final int MAX = 122;
final int STOPLINE1 = 85;
final int STOPLINE2 = 122;

for(d = MAX; d <= MIN; d++)
{
letter = (char) d;
System.out.print(" " + letter);

if((d == STOPLINE1)&&(d == STOPLINE2))

System.out.println();
}
System.out.println("\nEnd of application");

}
}

Share: 

 

2 Answers Found

 
Answer #1    Answered On: Nov 13    

You said that you have problem with this code, but you didn't mentioned what is the problem, well looking at your code i find one problem, may be if that can help you.

Wrong Loop


for(d = MAX; d <= MIN; d++)


Right approach would be

for(d = MIN; d <= MAX; d++)


Hope this helps

 
Answer #2    Answered By: BERTO PEREZ     Answered On: Nov 13

MR. Patel

Thank you very much, my problem was that the code doesn't compiled, but I saw your answer and that help me to resolve the problem, Again thank you very much.

 
Didn't find what you were looking for? Find more on problem with my code Or get search suggestion and latest updates.
This post is locked for further answers.




Tagged: