Search:

Type: Posts; User: kenster421

Page 1 of 3 1 2 3

Search: Search took 0.23 seconds.

  1. Replies
    2
    Views
    360

    Re: What are enumsets and maybe maps?

    EnumSets are exactly what they sound like.

    The class is used to collect a Set of a specific Enum (note the parameterization).

    You can use this class to iterate over, clone, or serialize the Set.
  2. Replies
    4
    Views
    297

    Re: Pleeeeeese help me with this program

    Sound propagates through mediums at different rates depending on the medium's density. Going in order from slowest to fastest: gases, liquids, solids. Your goal is to user simple console input to...
  3. Replies
    1
    Views
    167

    Re: UI Elements in tabbed view not loading

    It seems that CoordinatorLayout wasn't the best layout to use for my tab fragment. The ListView was pushing the Button out of the viewable space on first load and, for some reason, was only being...
  4. Replies
    1
    Views
    167

    UI Elements in tabbed view not loading

    I'm using a FragmentStatePagerAdapter to manage three tabbed Fragments that each have a ListView and a button. When the parent Fragment loads the via the ViewPager and PagerAdapter, the Button is...
  5. Replies
    5
    Views
    887

    Re: A deadly combination

    I can see your desire to use the Strategy Pattern to fulfill your need of CRUD; however, do not let Design Patterns entice you into doing something that is, programmatically, a poor decision.

    When...
  6. Replies
    7
    Views
    3,071

    Re: Calendar from user input PROBLEM!

    On any given calendar there are 5 weeks given that 31/7 = 4.42...

    A simple way to think of the calendar is that it's like an array: 5 rows, 7 columns;

    int[][] dates = new int[5][7];


    You...
  7. Replies
    1
    Views
    850

    Re: Dymaic Casting of List

    The easiest way is to use inheritance. The best way is to use object composition.

    How will you decide which object you want to cast it into? Why does your "List object" not contain a parameter....
  8. Replies
    7
    Views
    3,071

    Re: Calendar from user input PROBLEM!

    It wont go past 9 because you have a limiting if statement in your logic. Why is it there?
  9. Re: Tic Tac Toe Program, Can someone help me out????

    You need to use debug and step through your code, line-by-line. It isn't complicated and should give you a good idea of where you are going wrong. After a cursory look at the code, I can't see any...
  10. Replies
    8
    Views
    1,943

    Re: ArrayList question

    In order to create your own hashmap, you need a key->value pair.

    This would be helpful:

    public class HashMapImp
    {
    public static void main(String args[])
    {
    MyHashMap mhm = new...
  11. Replies
    1
    Views
    1,500

    Re: read a file word by word

    You should read the entire file into a String and use the replace method for strings.
    String (Java Platform SE 6)
    Note that since you want to switch tags around you will need to create a temporary...
  12. Replies
    30
    Views
    2,934

    Re: Strings not being added to arraylist

    You left out some key details. What does your constructor for Roster actually do? I see that you define teamRoster in class Roster immediately. Do this in the constructor to ensure that it gets...
  13. Re: How to convert local path drive to UNC path

    Basic String concatenation should do just fine.

    Change your \ to / and follow the UNC conventions.
  14. Replies
    3
    Views
    1,890

    Re: Using Comparable in Binary Search

    The comparable interface will assist you in comparing objects.

    Comparable (Java 2 Platform SE v1.4.2)

    You will need to implement the methods in your class BinarySearch when you add the...
  15. Replies
    1
    Views
    2,580

    Re: double LinkedList (insersion sort)

    What you need to do is implement a Doubly Linked List and ensure that you have add(), insert(), remove() working correctly.

    Insertion sort is one of the easiest algorithms to implement.

    After...
  16. Re: Problem with Reading very long line using bufferedReader

    Apparently, BufferedReader is better for reading line streams from a text file and the limit for strings is 2 billion characters. My suggesstion: read the file one character at a time...
  17. Re: Problem with Reading very long line using bufferedReader

    Try using a scanner instead:


    Scanner scanner = new Scanner(new File(inFile));

    while(scanner.hasNextLine())
    {
    System.out.println(scanner.nextLine());
    }
  18. Replies
    3
    Views
    995

    Re: Data Structure

    Using data structures effectively is all about thinking about how a program needs to operate. Yes, arrays do have a fixed size, but you can always create another array.

    Consider this example:
    ...
  19. Re: Finding Multiple Equal Max Values in an Array

    Using an ArrayList seems like overkill.

    I think you should use multiple methods:

    int getHighestScore()
    Player[] getWinners()
    void printWinners()

    Inside the getWinners() method, you create...
  20. Re: [Method] How to calculate the sum of a Row or Column in a Multi Dimensional Array

    The first thing you should realize is the "direction" that the active element takes in a multidimensional array when traversing through it.

    The 2D array:

    int[][] matrix = new int[3][4];...
  21. Re: Simplest Problem but i am unable to understand it, WHY???

    Mr. 777,

    You have a logical error in your post that
    'a' is not an object, it is a reference to an object of type A.

    You have classes A and B where B is a subclass of A.

    In your code, you...
  22. Replies
    3
    Views
    1,106

    Re: SORTING ALGORITHMS...

    First, read this on Selection Sort: Selection sort - Wikipedia, the free encyclopedia.

    Make sure you are following that algorithm.

    If the length of the arrary is n, you will make n passes. On...
  23. Replies
    3
    Views
    3,389

    Re: Simple client-server chat program

    This site has simple solutions for TCP and UDP servers that you can use to establish if what you are doing is correct.

    A Simple Java TCP Server and TCP Client | systemBash
  24. Replies
    2
    Views
    1,468

    Re: Palindrome program help

    What is the point of this code segment?

    After you ask for a palindrome, you assign it to strippedInput and then immediately expect more input. Why?



    What if the string has an even number of...
  25. Replies
    4
    Views
    819

    Re: Length of Java source files?

    The good thing about Java is that you can break apart large files like the one you are writing into multiple files easily via copy/paste. Java was designed to be an object-oriented language, so there...
Results 1 to 25 of 72
Page 1 of 3 1 2 3