IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Java Discussion :

Création d'une classe Java avec Netbeans


Sujet :

Java

  1. #1
    Membre averti
    Femme Profil pro
    Étudiant
    Inscrit en
    Mars 2019
    Messages
    30
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 29
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2019
    Messages : 30
    Par défaut Création d'une classe Java avec Netbeans
    bonsoir
    je voudrais crée une classe java avec netbeans
    il y'a un petit problème je ne peut pas le résoudre
    voici mon programme que je souhaite lancer à partir de main :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    package javaapplication6;
     
    /**
     *
     * @author AGORA
     */
    public class MAIN06 {
     
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            newlogin con = new newlogin();
     
            con.setVisible(true);
    bts2G b1 =new bts2G("GSM","AGILETE_GSM","35.418354","10.341609","33AGIGA","10","54","33371","132","90");
    System.out.println(b1.toString());
     
     
        }
     
    }
    et j'ai aussi créé une classe :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    package javaapplication6;
     
    /**
     *
     * @author AGORA
     */
    public class bts2G {
     
     /* DECLARATION DES CHAMPS DU BTS */
     
        private String SYSTEM;
         private String SITE;
          private String LAT;
           private String LON;
            private String CELL;
             private String CH;
              private String CID;
              private String LAC;
              private String DIR;
     
     
     
     
         /* METHODES DE LIRE LES CHAMPS */
     
     
         /* METHODES DE ECRIRE LES CHAMPS */
     
         /* DESIGNE LA POSITION DE SITE EN FORME DE CERCLE DANS LA POSITION X,Y
        
        DANS UNE DEXIEME ETAPE ON VA DESIGNE LA COUVERTURE DE CHAQUE CELLULE*/
     
        public bts2G(String SYSTEM, String SITE, String LAT, String LON, String CELL, String CH, String CID, String LAC, String DIR) {
            this.SYSTEM = SYSTEM;
            this.SITE = SITE;
            this.LAT = LAT;
            this.LON = LON;
            this.CELL = CELL;
            this.CH = CH;
            this.CID = CID;
            this.LAC = LAC;
            this.DIR = DIR;
     
        }
     
        bts2G(String gsm, String agilete_gsm, String string, String string0, String agiga, String string1, String string2, String string3, String string4, String string5) {
     
        }
     
        public String getSYSTEM() {
            return SYSTEM;
     
        }
     
        public void setSYSTEM(String SYSTEM) {
            this.SYSTEM = SYSTEM;
        }
     
        public String getSITE() {
            return SITE;
        }
     
        public void setSITE(String SITE) {
            this.SITE = SITE;
        }
     
        public String getLAT() {
            return LAT;
        }
     
        public void setLAT(String LAT) {
            this.LAT = LAT;
        }
     
        public String getLON() {
            return LON;
        }
     
        public void setLON(String LON) {
            this.LON = LON;
        }
     
        public String getCELL() {
            return CELL;
        }
     
        public void setCELL(String CELL) {
            this.CELL = CELL;
        }
     
        public String getCH() {
            return CH;
        }
     
        public void setCH(String CH) {
            this.CH = CH;
        }
     
        public String getCID() {
            return CID;
        }
     
        public void setCID(String CID) {
            this.CID = CID;
        }
     
        public String getLAC() {
            return LAC;
        }
     
        public void setLAC(String LAC) {
            this.LAC = LAC;
        }
     
        public String getDIR() {
            return DIR;
        }
     
        public void setDIR(String DIR) {
            this.DIR = DIR;
        }
     
        @Override
        public String toString() {
            return "bts2G{" + "SYSTEM=" + SYSTEM + ", SITE=" + SITE + ", LAT=" + LAT + ", LON=" + LON + ", CELL=" + CELL + ", CH=" + CH + ", CID=" + CID + ", LAC=" + LAC + ", DIR=" + DIR + '}';
        }
     
    }
    lors de l'éxécution le sortie affiche null
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    run:
    bts2G{SYSTEM=null, SITE=null, LAT=null, LON=null, CELL=null, CH=null, CID=null, LAC=null, DIR=null}
    BUILD SUCCESSFUL (total time: 3 seconds)
    merci de ma aide

  2. #2
    Modérateur
    Avatar de wax78
    Homme Profil pro
    R&D - Palefrenier programmeur
    Inscrit en
    Août 2006
    Messages
    4 095
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : R&D - Palefrenier programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 095
    Par défaut
    Le corps du constructeur prenant 10 paramètres est vide. C'est donc normal que tes champs restent null.
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

Discussions similaires

  1. Compilation d'une classe java avec cmd appelant une autre classe
    Par y_chafaqi dans le forum Général Java
    Réponses: 10
    Dernier message: 09/12/2009, 20h24
  2. Réponses: 1
    Dernier message: 24/08/2009, 13h09
  3. "Décharger" une classe java avec un ClassLoader Custo
    Par GLSpirit dans le forum Langage
    Réponses: 3
    Dernier message: 28/05/2009, 11h34
  4. compiler une classe java avec javac
    Par crespoo dans le forum Débuter avec Java
    Réponses: 8
    Dernier message: 20/04/2009, 18h32
  5. Créer une classe .java avec un code java
    Par demcoul dans le forum Langage
    Réponses: 10
    Dernier message: 03/01/2008, 00h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo