how does this look?
import java.util.*;
import java.text.*;
import java.io.*;
public class FileLogger extends SimpleLogger {
private File logFile;
Type: Posts; User: nickar1172
how does this look?
import java.util.*;
import java.text.*;
import java.io.*;
public class FileLogger extends SimpleLogger {
private File logFile;
i don't know any log() methods that's the problem, I am a beginner in an advanced course, I thought the methods that I already have are the log methods that output but I guess I'm wayyyy off
---...
yes but what log methods are you talking about that is where I am also lost
This is my new code, apparently my logger methods are "empty" and because of that I have no output. How do I go about fixing this??
import java.util.*;
import java.text.*;
import java.io.*;
...
but then wouldn't the file logger be an abstract also if it extends SimpleLogger? so then the FileLogger class would be :
public abstract class FileLogger extends SimpleLogger
but then it would change:
public class MyProgram {
private SimpleLogger logger;
public static void main(String[] args) {
try {
SimpleLogger logger =...
but since FileLogger is a singleton doesnt that make the constructor private to something like
return new FileLogger();
cant be compiled?
public class LoggerFactory {
public static SimpleLogger getLogger(String log) {
return new SimpleLogger(log);
}
}
I had a feeling that it had to be changed to abstract as well as the set method I just overlooked.
This is the error code I keep getting:
Exception in thread "main"...
I keep getting this error and I cant figure out why, the only thing is I cannot change the My Program class bc that was given by my instructor everything else is flexible
public abstract class...
1. Yes it is a project requirement
2. I'm not 100% positive the only thing I know is that we create our own exceptions so whatever is needed to be inputted in regards to error that are in the file...
We start with a SimpleLogger which is an abstract class. It is a parent class of FileLogger, which is a concrete Singleton class that represents a single Logger. It also has all of the methods...
Ok so here it goes, I have the format down I just don't know where and what the syntax is supposed to be for these classes. I have 5 classes:
SimpleLogger - Abstract Class
FileLogger - Singleton...