Search:

Type: Posts; User: copeg

Page 1 of 20 1 2 3 4

Search: Search took 0.61 seconds.

  1. Re: Benchmarking Arrays vs Linked Linked vs Custom Linked List

    I disagree. One suggestion is to run the loops multiple times, in different orders to control for optimization, and your code has things like autoboxing going on where JVM optimization and/or caching...
  2. Re: Benchmarking Arrays vs Linked Linked vs Custom Linked List

    I would recommend being very careful in interpreting the results. Profiling can be quite touchy - especially when comparing very short time frames such as this. Profile times can be affected greatly...
  3. Replies
    9
    Views
    415

    Re: Multiplication until user inputs 0

    @susilaarya, please read the forum guidelines as well as http://www.javaprogrammingforums.com/cafe/9544-problem-spoon-feeding.html
  4. Replies
    1
    Views
    74

    Re: Key Event shortcuts

    Be sure the component that contains the KeyListener has focus. Look at the requestFocus() method of Component, or look into using Key Bindings
  5. Replies
    1
    Views
    89

    Re: Searching in files

    Use the equals() method to compare String objects. Another note: you are reading the file line by line, and comparing each line to the JTextField text - if you require more complex behavior then you...
  6. Thread: Odious number

    by copeg
    Replies
    11
    Views
    1,271

    Re: Odious number

    @HeadshotAttained, please read http://www.javaprogrammingforums.com/cafe/9544-problem-spoon-feeding.html , and please don't resurrect long dead threads. Locked
  7. Replies
    4
    Views
    152

    Re: How do people learn java ..?

    In addition to the links Kevin provided about, here is another link that I consider recommended reading related to your question: Teach Yourself Programming in Ten Years
  8. Re: Populate JTable with JTextField , JComboBox, and JLabel

    That doesn't mean your code has to. See the "Creating a TableModel" section. Further, to quote that section: "If the programmer does not provide a table model object, JTable automatically creates an...
  9. Re: How to read in two columns of a .dat to a BST

    Suggested reading: https://docs.oracle.com/javase/tutorial/essential/io/index.html In particular, have a look at the BufferedReader class
  10. Thread: Read

    by copeg
    Replies
    4
    Views
    135

    Re: Read .txt file into an array

    Read one line and discard prior to processing the rest of the file.
  11. Thread: Read

    by copeg
    Replies
    4
    Views
    135

    Re: Read .txt file into an array

    String[] details = line.split("|");

    See the API for the String.split method - it accepts a regular expression. '|' is a regular expression logical operator and I do not believe this is what you...
  12. Replies
    4
    Views
    176

    Re: use of Generics in map reduce program

    Recommended reading: Lesson: Generics (Updated) (The Java™ Tutorials > Learning the Java Language)
  13. Replies
    9
    Views
    172

    Re: Fibonacci code in Java

    Calculating the Fibonacci sequence is a standard programming exercise that one can learn a lot from - lets please stop robbing the original poster of this exercise by posting different varieties of...
  14. Thread: Need Help

    by copeg
    Replies
    10
    Views
    186

    Re: Need Help

    Threads merged. Please read the Forum Guidelines
  15. Thread: How to use where

    by copeg
    Replies
    6
    Views
    269

    Re: How to use where

    I cannot see the screenshots. My recommendations 1) please copy and paste the stack trace directly to the forum 2) post the relevant code such that the line numbers line up with the stack trace (eg...
  16. Thread: How to use where

    by copeg
    Replies
    6
    Views
    269

    Re: How to use where

    Is that a compiler error, or a runtime error? I would recommend providing as much information as possible (stack traces, SSCCE, etc...) - in its current state no one can run your code to reproduce...
  17. Replies
    4
    Views
    100

    [SOLVED] Re: Throwing Exceptions Problem

    The exception states there is no constructor that accepts those arguments, so I'd recommend having a look at the Employee class. Is there a constructor? Is the following a constructor?



    See...
  18. Re: Inserting mySQL record via JDBC, java code insert syntax error

    Forget JDBC for the moment - I would recommend opening up a SQL command line interface and execute the command from there - this makes debugging SQL commands much easier as it doesn't have the added...
  19. Thread: How to use where

    by copeg
    Replies
    6
    Views
    269

    Re: How to use where

    You tell us? What happens when you tried to execute it? Can you execute this statement directly with your SQL command line interface?
  20. Replies
    7
    Views
    168

    Re: JTree Branch Icon Rendering

    public Component.getTreeCellRendererComponent(JTree tree, Object value,boolean selected,boolean expanded, boolean leaf, boolean row, boolean hasFocus)


    I don't understand the line above - this...
  21. Replies
    3
    Views
    126

    Re: Avoid duplicates on ArrayList

    As an alternative to List, and better suited at dealing with duplicates, see The Set Interface (The Java™ Tutorials > Collections > Interfaces)
  22. Replies
    11
    Views
    150

    Re: BinarySearchTree findSmallest problem..

    Reread the my last post - it suggest following the parent nodes - where will those take you? (Perhaps to the root of the matter - hint, hint...)
  23. Replies
    11
    Views
    150

    Re: BinarySearchTree findSmallest problem..

    That's an answer relative to where you are - there should be a more absolute place to start (what if you keep following the 'left tree parent node'?)
  24. Re: TRying to implementing from 32bit to 64 bit..

    An int by definition is 32-bit, so the default behavior of Object.hashCode is by definition 32-bit. One must use a different data type if you want 64 bit - in which case you cannot use the default...
  25. Replies
    11
    Views
    150

    Re: BinarySearchTree findSmallest problem..

    Think about the algorithm used to traverse the tree to find the smallest - where should it start?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4