Results 1 to 2 of 2
Thread: how to write except in java??
- 08-09-2010, 04:33 AM #1
Member
- Join Date
- May 2010
- Posts
- 7
- Rep Power
- 0
how to write except in java??
hello,
i have some problems regarding on how to write exception for a job
this is my code:
Java Code:..... for (i=starti-1; i<=starti+1; i++){ for (j=startj-1; j<=startj+1; j++){ if ( i! = starti && j! = startj){ System.out.println( "i: "+i+" j: "+ j +" ");} ....} }
i want to print the coordinate i and j except for both i not equal to starti and j not equal to startj [starti & startj is given earlier]. with the method i used here the code just read if i not equal starti or j not equal to start j.
so anyone can gives idea on doing this?? :confused:Last edited by Fubarable; 08-09-2010 at 04:48 AM. Reason: Moderator Edit: Code tags added
-
Please note that I edited your code above to add code tags so that the code will retain its formatting and be readable. To learn to do this yourself, please check out the appropriate link in my signature.
Now, as to your problem, does your code above even compile? For something to not equal something else you don't do
Java Code:if (a! = b) { // won't work
but rather
Java Code:if (a != b) {
Similar Threads
-
New to java and does not know how to write the code ...
By poisson in forum New To JavaReplies: 57Last Post: 07-15-2010, 04:10 AM -
XML read/write in Java
By bogdy.laurentiu in forum XMLReplies: 5Last Post: 05-31-2010, 06:08 PM -
How to read/write txt in Java
By megalomitis in forum New To JavaReplies: 2Last Post: 11-13-2009, 10:09 AM -
How do i write this in java...?
By johnny7white in forum New To JavaReplies: 1Last Post: 11-28-2007, 07:05 PM -
Help with write file in java
By mathias in forum New To JavaReplies: 1Last Post: 07-31-2007, 06:51 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks