Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6211427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:20:07+00:00 2026-05-24T06:20:07+00:00

I was getting the following error message while trying to debug my code: Not

  • 0

I was getting the following error message while trying to debug my code:

Not able to submit breakpoint MethodBreakpoint [tarea11.Main].contarCapas '(Ljava/util/TreeSet<tarea11/punto>;)I', reason: Method 'contarCapas' with signature '(Ljava/util/TreeSet<tarea11/punto>;)I' does not exist in class tarea11.Main.

Now I realize that the contarCapas method ain’t working at all, it’s as if it isn’t even declared.

Version 1:

package tarea11;


import java.io.File;
import java.io.IOException;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Scanner;
import java.util.TreeSet;

/**
 *
 * @author darwin
 */

class punto{
    int x;
    int y;
    boolean usado;


    public punto(int x, int y) {
        this.x = x;
        this.y = y;
        this.usado=false;

    }


    static double pendiente (punto p1, punto p2){
        double M = (p2.y - p1.y) / (p2.x - p1.x);
        return M;

    }

    @Override
    public boolean equals (Object o1){

        if (o1 instanceof punto){

            punto p1 = (punto)o1;
            if (p1.x==this.x&& p1.y==this.y){

                return true;
            }
              return false;

        }

        else

            return false;

    }

    @Override
    public int hashCode() {

       String string = this.x+" "+this.y;
       return string.hashCode();

    }

}

class PointComparator implements Comparator {

    public int compare(Object o1, Object o2){

        punto p1 = (punto)o1;
        punto p2 = (punto)o2;

        if (p1.y>p2.y){
            return 1;
        }
        if(p2.y > p1.y)
        {
            return -1;
        }

        else{

            if(p1.x>p2.x){
                return 1;
            }
            return -1;
        }


    }

}

public class Main {


    static int contarCapas (TreeSet<punto> puntosOrdenados){

        int numeroDeCapas=0;

        HashSet <punto> puntosUsados = new HashSet<punto>();

        while (!puntosOrdenados.isEmpty()){

            punto p= puntosOrdenados.pollFirst();

            puntosUsados.add(p);

            //chequear contra todos los demas para hallar minArco
            double minArco=99999999;
            punto minPunto = new punto(-2001,-2001);
            double arco=0;
            for (punto siguiente: puntosOrdenados){

                if(siguiente.equals(p)){
                    continue;
                }

                arco=Math.atan2(p.y - siguiente.y, p.x - siguiente.x);
                if (arco< minArco){
                    minArco=arco;
                    minPunto = siguiente;
                }

            }

            if (puntosUsados.contains(minPunto)){

                numeroDeCapas= numeroDeCapas+1;

            }

        }

        return numeroDeCapas;

    }


    public static void main(String[] args) {

        PointComparator pointComparator = new PointComparator();

        System.out.println(Math.atan2(-1.0, 1.0));
        //System.out.println(Math.acos(cont))
        Scanner s = new Scanner(System.in);

        try{
        s = new Scanner(new File("entrada.txt"));
        } catch(IOException e){}
        int N,x,y;

        N = s.nextInt();

        while(N!=0){

            punto cebolla[] = new punto[N];

            TreeSet <punto> puntosOrdenados = new TreeSet <punto>(pointComparator);

            for(int i=0;i<N;i++){
                x=s.nextInt(); y=s.nextInt();
                cebolla[i]=new punto(x,y); //borrar?
                puntosOrdenados.add(new punto(x,y));
            }


           int cont= contarCapas(puntosOrdenados);
           System.out.println(cont);

             if(cont%2==0){
                System.out.println("NO");
             }else{
                System.out.println("SI");
             }
             N = s.nextInt();
        }
    }


    }

version 2:

package tarea11;


import java.io.File;
import java.io.IOException;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Scanner;
import java.util.TreeSet;

/**
 *
 * @author darwin
 */

class punto{
    int x;
    int y;
    boolean usado;




    public punto(int x, int y) {
        this.x = x;
        this.y = y;
        this.usado=false;

    }


    static double pendiente (punto p1, punto p2){
        double M = (p2.y - p1.y) / (p2.x - p1.x);
        return M;

    }

    @Override
    public boolean equals (Object o1){

        if (o1 instanceof punto){

            punto p1 = (punto)o1;
            if (p1.x==this.x&& p1.y==this.y){

                return true;
            }
              return false;

        }

        else

            return false;

    }

    @Override
    public int hashCode() {

       String string = this.x+" "+this.y;
       return string.hashCode();

    }

}

class PointComparator implements Comparator {

    public int compare(Object o1, Object o2){

        punto p1 = (punto)o1;
        punto p2 = (punto)o2;

        if (p1.y>p2.y){
            return 1;
        }
        if(p2.y > p1.y)
        {
            return -1;
        }

        else{

            if(p1.x>p2.x){
                return 1;
            }
            return -1;
        }


    }

}

public class Main {


     int contarCapas (TreeSet<punto> puntosOrdenados){

         System.out.println("asdasdf");
        int numeroDeCapas=0;

        HashSet <punto> puntosUsados = new HashSet<punto>();

        while (!puntosOrdenados.isEmpty()){

            punto p= puntosOrdenados.pollFirst();

            puntosUsados.add(p);

            //chequear contra todos los demas para hallar minArco
            double minArco=99999999;
            punto minPunto = new punto(-2001,-2001);
            double arco=0;
            for (punto siguiente: puntosOrdenados){

                if(siguiente.equals(p)){
                    continue;
                }


                arco=Math.atan2(p.y - siguiente.y, p.x - siguiente.x);
                if (arco< minArco){
                    minArco=arco;
                    minPunto = siguiente;
                }

            }

            if (puntosUsados.contains(minPunto)){

                numeroDeCapas= numeroDeCapas+1;

            }

        }

        return numeroDeCapas;

    }



    public static void main(String[] args) {

        PointComparator pointComparator = new PointComparator();

        System.out.println(Math.atan2(-1.0, 1.0));
        //System.out.println(Math.acos(cont))
        Scanner s = new Scanner(System.in);

        try{
        s = new Scanner(new File("entrada.txt"));
        } catch(IOException e){}
        int N,x,y;

        N = s.nextInt();

        while(N!=0){

            punto cebolla[] = new punto[N];

            TreeSet <punto> puntosOrdenados = new TreeSet <punto>(pointComparator);

            for(int i=0;i<N;i++){
                x=s.nextInt(); y=s.nextInt();
                cebolla[i]=new punto(x,y); //borrar?
                puntosOrdenados.add(new punto(x,y));
            }

           Main m = new Main();
           int cont= m.contarCapas(puntosOrdenados);
           System.out.println(cont);

             if(cont%2==0){
                System.out.println("NO");
             }else{
                System.out.println("SI");
             }
             N = s.nextInt();
        }
    }


    }

That gibbering println inside contarCapas isn’t printing. The code isn’t entering its call. Why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:20:09+00:00Added an answer on May 24, 2026 at 6:20 am

    That’s what I’d expect to see if your source is out of sync with the bytecode that’s running. Try a clean build of the code, or you could also use javap to disassemble the bytecode and see if it looks like it matches the source, depending on your situation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the following error while trying to add a NOT NULL column
I am getting following error while exporting data to excel sheet ERROR: Message :
I am getting the following error message while installing, let me know if I
I am using Visual Studio 2005. While debugging code I am getting following error
I am getting the following error message on the code below (which is at
We’re getting the following error message when we click on Search Settings for a
I'm getting the following error when trying to run a JSP. I'm using Tomcat
I'm getting the following error when trying to build my app using Team Foundation
Am getting following error message on calling WCF service: The formatter threw an exception
I'm getting the following error when I compile the following code on Visual Studio

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.