Results 1 to 4 of 4
  1. #1
    falconmick is offline Member
    Join Date
    Sep 2010
    Posts
    2
    Rep Power
    0

    Unhappy Breakpoints not working :(

    im using NetBeans:
    Java Code:
    Listening on javadebug
    User program running
    LineBreakpoint q2.java : 20 successfully submitted.
    Not able to submit breakpoint MethodBreakpoint [q2].conv2RevArray '(II)Lvoid;', reason: Method 'conv2RevArray' with signature '(II)Lvoid;' does not exist in class q2.
    User program finished
    and this is my code:
    Java Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    
    /**
     *
     * @author Michael Crook
     */
    import java.util.*;
    import java.lang.Math.*;
    public class q2 {
    
        static int lengthOfInt(int input)
        {
            int i;
    
            if(input < 0)
            {
                input = input*-1;
            }
            for(i = 0; (int)Math.pow(10, i)<input; i++)
            {
                input = i;
            }
            return(input);
        }
    
        static void conv2RevArray(int input, int[] intArray)
        {
            int n = intArray.length, i, topEnd = 0;
            intArray = new int[n];
            for(i = 0; i<n; i++)
            {
                topEnd = topEnd * 10;
                intArray[(i)] = (int)(input / (1 * Math.pow(10, n - (i+1))));
                topEnd = topEnd+intArray[(i)];
            }
            return;
        }
    
        static int getInput(String print)
        {
            System.out.print(print);
            Scanner input = new Scanner(System.in);
            return(input.nextInt());
        }
    
        static void printArray(int[] intArray)
        {
            int i;
            for(i = 0; i<intArray.length; i++)
            {
                System.out.print(intArray[i]);
            }
            return;
        }
    
        public static void main( String[] args)
        {
            int reps = 0;
            int endLoop = 0;
            int input = getInput("Please enter number to Palindorme: ");
            int n = lengthOfInt(input);
            int[] intArray = new int[n];
            do
            {
                do
                {
                    conv2RevArray(input, intArray);
                    reps++;
                    printArray(intArray);
                    endLoop = 1;
                }while(reps<45 || endLoop != 1); //repetitions > 44 is how many repititions 1 would take if it didn't succed each time therefor it is max reps
                reps = 0;
                System.out.println("If you wish to quit, please enter a negative number");
                input = getInput("Please enter number to Palindorme: ");
            }while(input >= 0);
        }
    }
    #NOTE it isn't complete, though 0 errors and logicaly sound, from what I can see.

    pritty much, as soon as I get to int n = lengthOfInt(input); (after int input = getInput("Please enter number to Palindorme: ");) It won't debug if I put a break past there... befor there it will let me break, though as soon as I get to that point it magicaly stops debugging and gives me "User program running" and stops... Please help.... Im fucked if I can't fix this problem, owwe and after than I have a method "printArray(intArray)" which doesn't work X( please please please help :((

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,453
    Rep Power
    25

    Default

    Method 'conv2RevArray' with signature '(II)Lvoid;' does not exist in class q2.
    User program finished
    Any ideas why the program doesn't think the above mentioned method exists?

  3. #3
    falconmick is offline Member
    Join Date
    Sep 2010
    Posts
    2
    Rep Power
    0

    Default

    No idea :( maybe for some reason the do loop never iterates... ill check now.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,015
    Rep Power
    20

    Default

    Is the code you're looking at the code that's running?

    Stick a println("someting or other") right at the start of main() and then see if that prints out the next time you run.

Similar Threads

  1. Why is my Do/While Not working?
    By Meta in forum New To Java
    Replies: 1
    Last Post: 05-11-2010, 06:05 PM
  2. working with JC
    By yuhobebbho in forum New To Java
    Replies: 0
    Last Post: 02-10-2010, 11:22 PM
  3. Replies: 8
    Last Post: 05-28-2008, 07:00 AM
  4. Working With ANT
    By JavaForums in forum Eclipse
    Replies: 0
    Last Post: 04-26-2007, 08:16 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •