Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. gorodish

    How do you usually define constants with a package?

    Interestingly, during a recent interview I was asked to discuss the disadvantages of using an interface to define constants.
  2. gorodish

    errors in the code

    As a test, I copied and pasted your code in a CarTest4.java file, and it compiles and runs fine; no errors. Your last error (java.lang.NoClassDefFoundError) is probably due to a bad classpath. Make sure your classpath includes the directory which contains CarTest4.class
  3. gorodish

    StreamTokenizer

    Sorry, I didn't understand your question at first. Perhaps this will work: File curDir = new File( original ); String parentPath = curDir.getParent(); File parentDir = new File( parentPath ); String parentDirName = parentDir.getName(); Seems like more code than necessary, though.
  4. gorodish

    StreamTokenizer

    You could also do something like this: File curDir = new File( original ); String parentDir = curDir.getName(); The File.getName() method returns the last directory/file name in a path.

Part and Inventory Search

Back
Top