Search:

Type: Posts; User: mia_tech

Page 1 of 4 1 2 3 4

Search: Search took 0.11 seconds.

  1. Re: Take multiple inputs in a single line.

    since your input is in the form of


    3
    10 20 30

    you could read the first line and then loop through the second line...


    /**code removed by moderator*/
  2. Re: Take multiple inputs in a single line.

    Are you reading from standard input or from a file?
  3. [SOLVED] Re: using the return of a method to initialize an ArrayList

    I just figure out what I was missing!
  4. [SOLVED] Re: using the return of a method to initialize an ArrayList

    ok I got it, but now I'm trying to output the content of allCust ArrayList and I'm getting nullPointerException.... could someone give me a hint? Thanks


    import java.util.*;

    public class Main...
  5. [SOLVED] using the return of a method to initialize an ArrayList

    how could I use the return of extractCustomers and initialze ArrayList<Customer> in main method?


    import java.util.*;

    public class Main {


    public static void main(String[] args) {
  6. Replies
    9
    Views
    1,257

    Re: why am I getting NullPointerException.

    that was kind of strange, since I get no feed back weather my solution is correct or not. Anyways, here it goes again. If someone could take a look at it and let me know if is correct


    public...
  7. Replies
    9
    Views
    1,257

    Re: why am I getting NullPointerException.

    ok, now I know what spoon-feeding is... I guess by removing my code is a sign that it was correct. Am asking b/c I would like to hear about a better implementation or at least a confirmation that it...
  8. Replies
    9
    Views
    1,257

    Re: why am I getting NullPointerException.

    ok I fixed the code, I think it should look like this


    /** Code removed by moderator */
  9. Replies
    9
    Views
    1,257

    why am I getting NullPointerException.

    guys, why am I getting NullPointerException when initializing the array? I ran debug mode and productName is null


    public class Main {

    public static void main(String[] args) {
    ...
  10. Re: checking for digit while reading from a file

    this is my implementation, but I'm getting "imputMisMatchException"


    public static void mixedF() {
    int numbers = 0;
    int words = 0;
    int num;
    try {
    ...
  11. Re: checking for digit while reading from a file

    nextInt() will give you an error once it encounters a letter... how would you handle that?
  12. checking for digit while reading from a file

    guys, let's say I have a file that contains

    1
    33
    b s
    4
    10
    f
    a
    120
  13. Re: how could I display a stack as FIFO instead of LIFO

    After changing type parameters Collections.reverse(pNum); is the way to go
  14. Re: how could I display a stack as FIFO instead of LIFO

    I have imported java.uitl.* which includes LinkedList. May be si b/c I have my own implementation of Stack class, which is basically the same with the basic methods top, pop, isEmpty
  15. Re: how could I display a stack as FIFO instead of LIFO

    that line didn't work... it didn't take a stack!
  16. how could I display a stack as FIFO instead of LIFO

    guys, if you have a stream of numbers: 1 2 20 -4 99 -3 -20. And you need to insert them into an Stack and display the positive numbers in the order they were insert them(if 1 is first, then 1 is...
  17. [SOLVED] Re: reading a stream of numbers from standard input

    I'm getting a bunch of strange numbers... I don't think I'm reading the correct input. At the same time I'm getting an outofboud exception. like I'm going beyond the 5 elements of the array

    ...
  18. [SOLVED] reading a stream of numbers from standard input

    guys, I'm trying to read a stream of numbers from standard input like: 2 3 -3 10 44 9 -1. The line ends once it read -1, but for some reason I have an endless loop... how could I read this stream of...
  19. Re: how could I output to a text area the output of a method

    I tried passing the JTextArea in the constructor to IPScanner class, and use setText method from there, but when I do a second scan, it outputs the results from the previous scan plus the new scan,...
  20. having problem declaring a generic type array in OrderSet class

    guys, I have declare a generic array in OrderSet class; however, during compilation is giving me an error:


    Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be...
  21. Replies
    1
    Views
    1,423

    is a Set the same as a Stack or LinkedList

    guys, I know that Stack and LinkedList basically have elements that are compose by the "value" and the "Link" pointing to the next value. Does Set have the same structure?

    Thanks
  22. Re: how could I output to a text area the output of a method

    how could I do the last thing you mentioned?
  23. how could I output to a text area the output of a method

    guys, I have a GUI that scan a range of ip address when press "scan" button; however, I'm having trouble displaying the result in the textArea box. I'm using a threads for my execution. here's the...
  24. Re: can I create an array in a parameterized class

    that's the problem I'm having. I don't know how to initialize a type <T> array. Also, I don't know the size of the array. Is it possible to do?
  25. can I create an array in a parameterized class

    lets say I want to create a parameterized class


    public class MySet<T extends Comparable> implements Set<T> {

    T[] n;

    MySet(T a)
    {
Results 1 to 25 of 91
Page 1 of 4 1 2 3 4