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

avec Java Discussion :

Erreur de compilation de type "multiple markers at this line"!


Sujet :

avec Java

  1. #1
    Membre du Club Avatar de mobi_bil
    Profil pro
    Inscrit en
    Février 2009
    Messages
    242
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 242
    Points : 52
    Points
    52
    Par défaut Erreur de compilation de type "multiple markers at this line"!
    Bonjour à tous, j'espère que vous êtes bien.
    Quand j'ai éssayé de compiler mon programme , j'ai eu un message d'érreur de type :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    multiple markers at this line...
    Voici le code source :
    http://www.developpez.net/forums/att...1&d=1235913703

    Si quelqu'un peut m'aider à corriger ces erreurs,merci.

  2. #2
    Membre chevronné Avatar de guigui5931
    Profil pro
    Chef de projet NTIC
    Inscrit en
    Avril 2006
    Messages
    1 667
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2006
    Messages : 1 667
    Points : 2 232
    Points
    2 232
    Par défaut
    Montre nous le code qui te donne cette erreur (la pièce jointe ne marche pas) et indique nous quelle est la ligne donnée par le compilateur.
    autant l'hiver éclate que l'hétéroclite
    le vrai geek c'est celui qui croit qu'il y a 1024 mètres dans un kilomètre

  3. #3
    Membre du Club Avatar de mobi_bil
    Profil pro
    Inscrit en
    Février 2009
    Messages
    242
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 242
    Points : 52
    Points
    52
    Par défaut
    Bonjour,
    Voici la partie ou il y a l'érreur :
    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
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
     
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.io.DataInputStream;
    import java.io.DataOutputStream;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.util.Hashtable;
    import java.util.Comparator;
    import java.util.ArrayList;
    import java.util.Iterator;
     
     
    class LinkedIterator<T> implements Iterator<T>{
    	private LinkedList<T> list;
    	private LinkedNode<T> current;
     
    	public LinkedIterator(LinkedList<T> list){
    		this.list = list;
    		this.current = list.getRoot();
    	}
     
    	@Override
    	public boolean hasNext() {
    		if(list.size() == 0){
    			return false;
    		}
    		return current != null;
    	}
     
    	@Override
    	public T next() {
    		LinkedNode<T> last = current;
    		current = current.getNext();
    		return last.getData();
    	}
     
    	@Override
    	public void remove() {
    		throw new UnsupportedOperationException("no deleting here!!");
    	}
     
    	public void rewind(){
    		current = list.getRoot();
    	}
    }
     
     
    class LinkedNode<T>{
    	private LinkedNode<T> next;
    	private T data;
     
    	public LinkedNode(T data){
    		this.data = data;
    	}
     
    	protected void setNext(LinkedNode<T> next) {
    		this.next = next;
    	}
     
    	public void insert(LinkedNode<T> node){
    		this.next = node;
    	}
     
    	public T getData(){
    		return data;
    	}
     
    	public LinkedNode<T> getNext() {
    		return next;
    	}
    }
     
     
     class LinkedList<T> implements Iterable<T>{
    	private LinkedNode<T> root;
    	private LinkedNode<T> last;
    	private int size = 0;
     
    	public int size(){
    		return size;
    	}
     
    	public LinkedNode<T> getRoot(){
    		return root;
    	}
     
    	protected LinkedNode<T> getLast() {
    		return last;
    	}
     
    	public void clear() {
    		root = null;
    		last = null;
    		size = 0;
    	}
     
    	public void add(T data){
    		if(size == 0){
    			root = new LinkedNode<T>(data);
    			last = root;
    		}
    		else{
    			LinkedNode<T> node = new LinkedNode<T>(data);
    			last.insert(node);
    			last = node;
    		}
    		size++;
    	}
     
    	public void addFirst(T data) {
    		if(size == 0){
    			root = new LinkedNode<T>(data);
    			last = root;
    		}
    		else{
    			LinkedNode<T> node = new LinkedNode<T>(data);
    			node.setNext(root);
    			root = node;
    		}
    		size++;
    	}
     
    	public T[] toArray(T[] prepared) {
    		if(prepared.length >= size) {
    			LinkedNode<T> cur = root;
    			for (int i = 0; i < size; i++) {
    				prepared[i] = cur.getData();
    				cur = cur.getNext();
    			}
     
    			return prepared;
    		} else {
    			throw new RuntimeException("Prepared Array not big enough!");
    		}
    	}
     
    	public void addAll(LinkedList<T> list) {
    		if(this.size == 0){
    			this.root = list.root;
    			this.last = list.last;
    			this.size = list.size;
    		}
    		else if(list.size == 0){
    			return;
    		}
    		else{
    			last.setNext(list.getRoot());
    			last = list.getLast();
    			size += list.size;
    		}
    	}
     
    	public T getData(int index) {
    		LinkedNode<T> current = root;
    		for(int i = 0; i < index; i++) {
    			current = current.getNext();
    		}	
    		return current.getData();
    	}
     
     
    	@Override
    	public Iterator<T> iterator() {
    		return new LinkedIterator<T>(this);
    	}
     
    	public LinkedList<T> sort(){
    		LinkedList<T> result = new LinkedList<T>();
    		Heap h = new Heap(this.size);
    		for (T t : this) h.push(t);
    		while(h.peek() != null) result.add((T)h.pop());
    		return result;
    	}
    }
     
     
     class Heap {
    	protected Object[] nodes;
    	protected int size = 0;
    	protected final Comparator<Object> comp;
     
     
    	public Heap(int capacity, Comparator<Object> cmp) throws IllegalArgumentException {
    		if (capacity <= 0)
    			throw new IllegalArgumentException();
    		nodes = new Object[capacity];
    		comp = cmp;
    	}
     
     
    	public Heap(int capacity) {
    		this(capacity, null);
    	}
     
    	/** perform element comaprisons using comparator or natural ordering **/
    	protected int compare(Object a, Object b) {
    		if (comp == null)
    			return ((Comparable) a).compareTo(b);
    		else
    			return comp.compare(a, b);
    	}
     
    	// indexes of heap parents and children
    	protected final int parent(int k) {
    		return (k - 1) / 2;
    	}
     
    	protected final int left(int k) {
    		return 2 * k + 1;
    	}
     
    	protected final int right(int k) {
    		return 2 * (k + 1);
    	}
     
    	/**
             * insert an element, resize if necessary
             **/
    	public void push(Object x) {
    		if (size >= nodes.length) {
    			int newcap = 3 * nodes.length / 2 + 1;
    			Object[] newnodes = new Object[newcap];
    			System.arraycopy(nodes, 0, newnodes, 0, nodes.length);
    			nodes = newnodes;
    		}
     
    		int k = size;
    		++size;
    		while (k > 0) {
    			int par = parent(k);
    			if (compare(x, nodes[par]) < 0) {
    				nodes[k] = nodes[par];
    				k = par;
    			} else
    				break;
    		}
    		nodes[k] = x;
    	}
     
    	/**
             * Return and remove least element, or null if empty
             **/
     
    	public Object pop() {
    		if (size < 1)
    			return null;
     
    		int k = 0; // take element at root;
    		Object least = nodes[k];
    		--size;
    		Object x = nodes[size];
    		nodes[size] = null;
    		for (;;) {
    			int l = left(k);
    			if (l >= size)
    				break;
    			else {
    				int r = right(k);
    				int child = (r >= size || compare(nodes[l], nodes[r]) < 0) ? l
    						: r;
    				if (compare(x, nodes[child]) > 0) {
    					nodes[k] = nodes[child];
    					k = child;
    				} else
    					break;
    			}
    		}
    		nodes[k] = x;
    		return least;
    	}
     
    	/** Return least element without removing it, or null if empty **/
    	public Object peek() {
    		if (size > 0)
    			return nodes[0];
    		else
    			return null;
    	}
     
    	/** Return number of elements **/
    	public int size() {
    		return size;
    	}
     
    	/** remove all elements **/
    	public void clear() {
    		for (int i = 0; i < size; ++i)
    			nodes[i] = null;
    		size = 0;
    	}
     
    	public Object[] getArray(){
    		return nodes;
    	}
     
    }

  4. #4
    Membre du Club Avatar de mobi_bil
    Profil pro
    Inscrit en
    Février 2009
    Messages
    242
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 242
    Points : 52
    Points
    52
    Par défaut
    Il y a une érreur dans la première classe

    class LinkedIterator<T> implements Iterator<T>
    L'érreur est dans les procedures :

    @Override
    public T next() {
    LinkedNode<T> last = current;
    current = current.getNext();
    return last.getData();
    }

    @Override
    public void remove() {
    throw new UnsupportedOperationException("no deleting here!!");
    }

    public void rewind(){
    current = list.getRoot();
    }
    Le type d'érreur est :

    Multiple markers at this line
    - implements java.util.iterator<T>.hasNext
    - The method hasNext() of type LinkedIterator<T> must override a
    superclass method

    Multiple markers at this line
    - implements java.util.iterator<T>.next
    - The method next() of type LinkedIterator<T> must override a superclass
    method

    Multiple markers at this line
    - implements java.util.iterator<T>.remove
    - The method remove() of type LinkedIterator<T> must override a
    superclass method


    il y a une érreur dans la classe
    class LinkedList<T> implements Iterable<T>
    L'érreur est dans la procedure
    @Override
    public Iterator<T> iterator() {
    return new LinkedIterator<T>(this);
    }

    Le type d'érreur est :
    Multiple markers at this line
    - implements java.lang.Iterable<T>.iterator
    - The method iterator() of type LinkedList<T> must override a superclass
    method

Discussions similaires

  1. Erreur de compilation "multiple definition of"
    Par cereal dans le forum Débuter
    Réponses: 3
    Dernier message: 22/02/2010, 17h29
  2. Réponses: 2
    Dernier message: 11/12/2009, 22h27
  3. Erreur de compilation : has incomplete type
    Par Plomeg dans le forum C++
    Réponses: 2
    Dernier message: 25/04/2009, 13h19
  4. erreur de compilation : probleme avec type de structure dans une classe
    Par medkarim dans le forum VB 6 et antérieur
    Réponses: 5
    Dernier message: 21/10/2008, 15h33
  5. Réponses: 4
    Dernier message: 17/10/2006, 12h00

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