hey,i'm having trouble with this code...it keeps saying there is an error..can you help me please...thank you in advance
cannot find symbol
symbol: constructor CompteBancaire()
location: class javaapplication18.compteBancaire
this is the class:

package javaapplication18;


 import javax.swing.*;
 import java.util.Scanner;

public class CompteBancaire
{
    

    
     private String nom,prenom,typecompte,currency;
  
     private int numerocompte;
  
     private double credit,debit,solde;
 
     private String dateouverture;
  
     private double couverture;
      

  public CompteBancaire()
  
          
    {
       
                     nom=JOptionPane.showInputDialog("Entrer le nom du client");
  
                     prenom=JOptionPane.showInputDialog("Entrer le prenom du client");
     
                     typecompte=JOptionPane.showInputDialog("Entrer le type de compte");
        
                     currency=JOptionPane.showInputDialog("Entrer le currency:");
      
                     numerocompte=Integer.parseInt(JOptionPane.showInputDialog("Entrer le numero du compte"));
              
                     credit=Double.parseDouble(JOptionPane.showInputDialog("Entrer le credit:"));
        
                     debit=Double.parseDouble(JOptionPane.showInputDialog("Entrer le debit:")); 
       
                     solde=Double.parseDouble(JOptionPane.showInputDialog("Entrer le solde:"));
                     dateouverture=JOptionPane.showInputDialog("Entrer la date d'ouverture du compte:");
                     couverture=Double.parseDouble(JOptionPane.showInputDialog("Entrer la couverture pour ce compte:"));
  
              }
           

             public CompteBancaire(String n,String p,String type,String cur,int num,double cre,double deb,double sol,String dateouv,double couv)
       {
                  nom=n;
                  prenom=p;
                  typecompte=type;
                  currency=cur;   
                  numerocompte=num; 
                  credit=cre;
                  debit=deb;
                  solde=sol;
                  dateouverture=dateouv;
                  couverture=couv;
              }
                  public CompteBancaire(String n,String p,String type,String cur,int num,String dateouv)
                  { 
                      nom=n;
                      prenom=p;
                      typecompte=type;
                      currency=cur;
                      numerocompte=num;
                      dateouverture=dateouv;
                  }
                 public void opcredit()
                 {
                     Scanner input=new Scanner(System.in);
                     System.out.println("Combien voulez vous placer d'argent?:");
                     credit=input.nextDouble();
                     solde=solde+credit;
                 }
              }

this is the main:

package javaapplication18;
 import javax.swing.*;
 import java.util.Scanner;

public class Main {

   
    public static void main(String[] args)
    {
  
      
       CompteBancaire C=new CompteBancaire();
   
        
    }

}

Recommended Answers

All 5 Replies

location: class javaapplication18.compteBancaire

For some reason the class in the error message starts with a lower case 'c'. Check your file name - it must match the name of the class, and case matters.

sorry that's my typing mistake the error message is :
cannot find symbol
symbol: constructor CompteBancaire()
location: class javaapplication18.CompteBancaire

Sorry, but I don't see anything wrong with your code. I just copied what you posted into some files & I can compile and run the code just fine. I am not getting the same error message you are getting.

mmm anyway thank you alot for your help :)...the codes woked properly with you?

i changed the name of the class and the application name and it works :) thx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.