Search:

Type: Posts; User: Rexshine

Page 1 of 2 1 2

Search: Search took 0.38 seconds.

  1. Which classes could I use to make a game?

    Hi, I must do a game similar to "snake" and I took a look to Sprites examples, but I think I can't learn how to do everything I wish in the time that I got to finish it. The only way I would have, is...
  2. Replies
    0
    Views
    532

    Why can't I use debugger?

    I get this error after trying to debug with a breakpoint in the main method of "Principal" class:

    ClassNotFoundException(Throwable). <init>(String, Throwable) line: 286
    Source not found.

    When...
  3. Replies
    1
    Views
    289

    Problems with an Object File

    Hi, i must do an "agenda" that is the file, you can choose with the programm. (i don't know how to do it like Norm told me with Files. to test "new StringReader("example"); with file of objects...)...
  4. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    will check it tomorrow, thank u , good night
  5. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    I don't understand you at all. Do you mean this?


    static String leeLinea(BufferedReader br) throws IOException{
    char caracter = '\0';
    int esNulo = 0;
    if((esNulo = (int) br.read()) ==...
  6. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    I tried many ways but this is the best. that doesn't show first character because i do a read() at start


    static String leeLinea(BufferedReader br) throws IOException{
    //Character caracter =...
  7. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    but then i could not return last string in my example input: new StringReader("En un lugar\r\nDe la mancha"))

    i only return first line "en un lugar" but second one has append the -1 with...
  8. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    "The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached"



    Some help please. How to return the string when it find \n or when...
  9. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    it shows '-1' : System.out.println(br.read());

    oh my god, now i understand what the -1 that uses the teacher means... thank you
    this is like index -1 for string index right?

    This is right?
    ...
  10. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    I did before, i see the char '?' then i search for char ? that is 63 and tried : if (caracter == (char)63) {return null;} but doesnt work. so i made this to find the ascii code for that char...
  11. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    Ok, i know exactly what i have to do: I must simulate readLine() method, reading char by char, and returning the first String when find carriage return, and if it is the end of file, must return...
  12. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    it's how i read a line from a file, but is just an example, how should my method work.
    Anyway, if it is too hard, 100% sure i missunderstood my problem. so i ask tomorrow to my teacher. thank you...
  13. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    "Need to do a method that return a String with the next line to read from a file. When it reach the end of file , it return null instead the String."



    Should do this: without using readLine()
    ...
  14. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    he don't really say it, but it has no sense that i use readLine inside my method that simulates readLine :confused:

    I don't think i should do this


    static String leeLinea(BufferedReader br)...
  15. Replies
    24
    Views
    489

    Re: simulate BufferedReader's readLine()

    a

    --- Update ---


    I must return null when it reach end of file.

    I must write the code of readLine()

    My method must pass a BufferedReader as parameter.
  16. Replies
    24
    Views
    489

    simulate BufferedReader's readLine()

    Any idea please? I am stuck, I look at BufferedReader methods but i didn't found any useful, need to do a method that return a String with the next line to read from a file. When it reach the end of...
  17. Replies
    10
    Views
    303

    Re: Read file and extract different tokens

    will take a look to SimpleDateFormat examples. Thanks
  18. Replies
    10
    Views
    303

    Re: Read file and extract different tokens

    Impossible to understand anything java.util.regex ^^,(only understood \\s+ pattern) . Thank you for today. Ill try to finish tomorrow my program with my "println" knowledge :-<
  19. Replies
    10
    Views
    303

    Re: Read file and extract different tokens

    Thank you for StringReader sugestion, I'm using henceforth.

    Okay i will fix it tomorrow what I'm trying to do, since you don't tell me is bad. But there isn't just a faster way? a method to read a...
  20. Replies
    10
    Views
    303

    Re: Read file and extract different tokens

    what do you mean with "put responses here", you mean i catch the response of the method that fill the file into a string? so i transfer it to the method that reads the file?
    anyway i don't...
  21. Replies
    10
    Views
    303

    Re: Read file and extract different tokens

    Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7 >= 7
    at java.util.Vector.elementAt(Unknown Source)
    at Ejercicio07.muestraCumpleaños(Birthday.java:164)
    at...
  22. Replies
    10
    Views
    303

    Read file and extract different tokens

    I'm getting mad, I made a code that is very bad for maintain and for read.... please help
    I am beginner with these classes that I am using, and I maybe missed an unknown methods for do my code...
  23. Replies
    8
    Views
    351

    Re: Delete a directory recursively

    Will consider for next time. thank you. It is too late, must go sleep, see you next day :).
  24. Replies
    8
    Views
    351

    Re: Delete a directory recursively

    edited, with translated method "deleteAll".
    Programm should delete directories recursively or a single file... that you pass as parameters, like "rm <file>" or "rm -r <directory" in linux...
  25. Replies
    8
    Views
    351

    Re: Delete a directory recursively

    import java.io.File;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.BufferedReader;

    public class Ejercicio04 {
    public static void main(String[] args) {
    try{...
Results 1 to 25 of 42
Page 1 of 2 1 2