G'day,
I'm fairly new to Java (being using C++, C# in the past), I am currently working on an assignment that prompts the user for a filename (from the console) which it then sources and reads data from (.log file), whilst (as Im sure all the Java enthusiasts out there would agree) it is simple enough to create this connection however it has been imposed that only log files are allowed to be opened, up until this point I have been using a basic substring method on the String filename provided to identify whether the last 3 characters in the string are "log", however this method seems a tab trivial and I was wondering if there is a more efficent way of performing this action??
Any guidance would be greatly appreciated,
David
Tags: