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...
Type: Posts; User: Rexshine
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...
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...
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...)...
will check it tomorrow, thank u , good night
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()) ==...
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 =...
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...
"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...
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?
...
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...
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...
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...
"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()
...
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)...
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.
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...
will take a look to SimpleDateFormat examples. Thanks
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 :-<
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...
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...
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7 >= 7
at java.util.Vector.elementAt(Unknown Source)
at Ejercicio07.muestraCumpleaños(Birthday.java:164)
at...
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...
Will consider for next time. thank you. It is too late, must go sleep, see you next day :).
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...
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{...