Computer Science Canada How to compare extension in java |
Author: | supahsain08 [ Fri Feb 22, 2008 11:04 am ] | ||
Post subject: | How to compare extension in java | ||
this is what i have to do . Write a program that prompts the user for a file name (including the extension), checks the extension and responds with a comment about the type of file, for example ? .doc That was a Word document! .xls That was an Excel spreadsheet! .java That was a Java source file! My code so far
I cant seem to figure out, any ideas |
Author: | Tony [ Fri Feb 22, 2008 11:47 am ] |
Post subject: | RE:How to compare extension in java |
mime type |
Author: | wtd [ Fri Feb 22, 2008 1:09 pm ] | ||
Post subject: | RE:How to compare extension in java | ||
Hmmm.... spot any problems? |
Author: | supahsain08 [ Fri Feb 22, 2008 3:16 pm ] |
Post subject: | RE:How to compare extension in java |
nope, no clue *first time using the scanner command |
Author: | wtd [ Fri Feb 22, 2008 3:27 pm ] |
Post subject: | RE:How to compare extension in java |
Has nothing to do with the Scanner class. |
Author: | Tony [ Fri Feb 22, 2008 3:37 pm ] |
Post subject: | RE:How to compare extension in java |
what file type is my.document.java ? |
Author: | supahsain08 [ Fri Feb 22, 2008 3:57 pm ] |
Post subject: | RE:How to compare extension in java |
java file thing is my teacher didn't teach us anything |
Author: | OneOffDriveByPoster [ Fri Feb 22, 2008 4:30 pm ] |
Post subject: | Re: RE:How to compare extension in java |
supahsain08 @ Fri Feb 22, 2008 3:57 pm wrote: java file
What did your teacher teach you? In any case, you might want to stick to java.lang.String for checking the extension.thing is my teacher didn't teach us anything |
Author: | Tony [ Fri Feb 22, 2008 4:50 pm ] | ||
Post subject: | Re: RE:How to compare extension in java | ||
supahsain08 @ Fri Feb 22, 2008 3:57 pm wrote: java file
That's not the answer I was looking for. Lets try again. Tony wrote: what file type is my.document.java ?
wtd wrote:
Hmmm.... spot any problems? |
Author: | supahsain08 [ Fri Feb 22, 2008 6:07 pm ] |
Post subject: | Re: RE:How to compare extension in java |
OneOffDriveByPoster @ Fri Feb 22, 2008 4:30 pm wrote: supahsain08 @ Fri Feb 22, 2008 3:57 pm wrote: java file
What did your teacher teach you? In any case, you might want to stick to java.lang.String for checking the extension.thing is my teacher didn't teach us anything he only taught us about if else command, and input in java he said learn other stuff using internet |
Author: | OneOffDriveByPoster [ Fri Feb 22, 2008 8:52 pm ] |
Post subject: | Re: RE:How to compare extension in java |
supahsain08 @ Fri Feb 22, 2008 6:07 pm wrote: he said learn other stuff using internet http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html will help. Seriously, write some pseudo-code so we can tell what your logic is for your program. If people do not seem to be helpful, it is because your program makes people think you do not have the right idea at all. |
Author: | supahsain08 [ Fri Feb 22, 2008 11:09 pm ] | ||
Post subject: | Re: How to compare extension in java | ||
k finished it i think
|