Method to read more than one java file call it in main program
In main program I read file using bufferedreader, and (try, catch),
Now this section is repeated in my code , how can I call function to do that ? By passing filepath ..I try it but I don't get any line of file ...
How can I get lines of files using function when I call it? ?
That code does not return a null, or anything else. It's not valid Java and it won't compile. (However it's easy to see why it would return null if it did compile - just ask what value of line allows the method to return.)
Please stop wasting our time and post the correct code.
Also fix your indentation before posting so people can see why your brackets don't match.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...