Skip to main content
Cleaned up wording of question. Suggestions in answers and comments do fix the issues.
Source Link
rcgldr
  • 376
  • 2
  • 11

Revising question: whatIssues with generics < E > and < E extends Comparable > in code below. What changes are needed in the code below to prevent DLList.push_front() and DLList.push_back() from accepting strings instead of Integers? There have been suggested changes in comments, but so far those changes haven't prevented using string instead of Integer. I'm running NetBeans 8.2 Patch 2, Java(TM) SE Runtime Environment 1.8.0_111-b14, old versions which could be the issue.

Is generic type ( in this case) being used in more places than needed for this code? I assume that objects include type information needed for compareTo().

Revising question: what changes are needed in the code below to prevent DLList.push_front() and DLList.push_back() from accepting strings instead of Integers? There have been suggested changes in comments, but so far those changes haven't prevented using string instead of Integer. I'm running NetBeans 8.2 Patch 2, Java(TM) SE Runtime Environment 1.8.0_111-b14, old versions which could be the issue.

Is generic type ( in this case) being used in more places than needed for this code? I assume that objects include type information needed for compareTo().

Issues with generics < E > and < E extends Comparable > in code below. What changes are needed in the code below to prevent DLList.push_front() and DLList.push_back() from accepting strings instead of Integers?

Rollback to Revision 10
Source Link
rcgldr
  • 376
  • 2
  • 11

Revising question: what changes are needed in the code below to prevent DLList.push_front() and DLList.push_back() from accepting strings instead of Integers? There have been suggested changes in comments, but so far those changes haven't prevented using string instead of Integer. I'm running NetBeans 8.2 Patch 2, Java(TM) SE Runtime Environment 1.8.0_111-b14, old versions which could be the issue.

Revising question: what changes are needed in the code below to prevent DLList.push_front() and DLList.push_back() from accepting strings instead of Integers? There have been suggested changes in comments, but so far those changes haven't prevented using string instead of Integer. I'm running NetBeans 8.2 Patch 2, Java(TM) SE Runtime Environment 1.8.0_111-b14, old versions which could be the issue.

issue with push_back was due a change in code not shown in question
Source Link
rcgldr
  • 376
  • 2
  • 11

Revising question: what changes are needed in the code below to prevent DLList.push_front() and DLList.push_back() from accepting strings instead of Integers? There have been suggested changes in comments, but so far those changes haven't prevented using string instead of Integer. I'm running NetBeans 8.2 Patch 2, Java(TM) SE Runtime Environment 1.8.0_111-b14, old versions which could be the issue.

Revising question: what changes are needed in the code below to prevent DLList.push_front() and DLList.push_back() from accepting strings instead of Integers? There have been suggested changes in comments, but so far those changes haven't prevented using string instead of Integer. I'm running NetBeans 8.2 Patch 2, Java(TM) SE Runtime Environment 1.8.0_111-b14, old versions which could be the issue.

added 405 characters in body
Source Link
rcgldr
  • 376
  • 2
  • 11
Loading
Reinstate non-code edit after rollback
Source Link
Toby Speight
  • 88.5k
  • 14
  • 104
  • 327
Loading
Rollback to Revision 5
Source Link
Toby Speight
  • 88.5k
  • 14
  • 104
  • 327
Loading
Became Hot Network Question
added 604 characters in body
Source Link
rcgldr
  • 376
  • 2
  • 11
Loading
deleted 15 characters in body
Source Link
rcgldr
  • 376
  • 2
  • 11
Loading
In addition to vnp's fix to title, I left out efficient for std::list:sort
Link
rcgldr
  • 376
  • 2
  • 11
Loading
edited title
Link
vnp
  • 58.7k
  • 4
  • 55
  • 144
Loading
use beg and end for nodepair class.
Source Link
rcgldr
  • 376
  • 2
  • 11
Loading
clean up typos
Source Link
rcgldr
  • 376
  • 2
  • 11
Loading
Source Link
rcgldr
  • 376
  • 2
  • 11
Loading