text: FAQs
  Search
  Recent Topics
  Flagged Topics
  Hot Topics
  Best Topics
  Register / Login
  Dirk Schreckmann
  Sheriff
  7,024
  334
  Threads
  0
  Cows
  since Dec 10, 2001
  Merit Badge info
  dirkschreckmann.com
  Cows and Likes
  Cows
  Total received
  0
  In last 30 days
  0
  Total given
  0
  Likes
  Total received
  2
  Received in last 30 days
  0
  Total given
  0
  Given in last 30 days
  0
  Forums and Threads
  Scavenger Hunt
  Rancher Scavenger Hunt
  Number Posts (7024/500)
  Number Threads Started (334 (7024/100)
  Number Threads Started (334 (7024/10)
  Number Threads Started (334/10)
  Number Likes Received (2/3)
  Number Likes Granted (0/3)
  Set bumper stickers in profile (0/1)
  Set signature in profile
  Set a watch on a thread
  Save thread as a bookmark
  Create a post with an image (0/1)
  Recent posts by Dirk Schreckmann
  java.rmi; java.net
  The
  Head First Java
  book includes good introductions to network programming and RMI.
  show more
  12 years ago
  Beginning Java
  Heres a twist: Instead of passing, I failed!
  Without repeating specific questions you had, could you please describe in more detail what was not covered in
  K&B
  ?
  show more
  12 years ago
  Programmer Certification (OCPJP)
  final variable and its value
  Take a look at
  Bloch and Gafter's Java puzzler on how
  final
  is maybe not quite as final as one might assume
  .
  show more
  12 years ago
  Beginning Java
  Problems with Using ReportWriter
  Perhaps you just need to add a missing JAR or two to the build path of your IDE. (For example, jt400.jar contains com.ibm.as400.util.CommandHelpRetriever and so jt400.jar must be present in the build path in order to use CommandHelpRetriever. I don't know what JARs or other resources contain the classes you're missing.)
  Sometimes adding libraries such as JARs to the build path is as simple as copying JAR files to the WEB-INF/lib folder within your project, if it's a web application.
  I'm assuming you just need help configuring your IDE, so I'm moving this to the IDEs forum...
  show more
  12 years ago
  Other IDEs, Version Control
  How to write generic method for this method?
  Minor comment:
  Instead of using string literals to represent classes, you could use class literals. The current commented-out implementation to check for type instances based on the ending class name segment wouldn't work given instances of two unrelated classes, where the name of one of them happens to end with the complete name of the other (e.g. A and AA, or Point and CounterPoint).
  Don't read the next paragraph if you'd rather investigate and discover on your own how to use class literals and methods of
  Class
  objects.
  To clarify my minor comment above,
  arrange(String className, Vector v, int p)
  could be changed to
  arrange(Class clazz, Vector v, int p)
  , and
  Test.arrange("String", v, p);
  could be changed to
  Test.arrange(String.class, v, p);
  . Then, you could use the
  isInstance(Object)
  method available to clazz.
  show more
  12 years ago
  Beginning Java
  Struts 2.0 novelty?
  The 2.0.x documentation linked from
  includes
  release notes
  , and links to release notes for previous versions, which list the "new features" with each release.
  show more
  12 years ago
  Struts
  How collection.toArray() works?
  mohan,
  It's not clear to me which part of this task you're stuck on.
  If you're unfamiliar with working with arrays in Java, part 9 of
  Bradly Kjell's "Introduction to Computer Science using Java"
  includes good lessons and practice exercises to help learn the subject.
  If you're not yet comfortable writing data to a text file, chapters 82, 83 and 87 in part 13 of Kjell's lessons cover the subject well.
  show more
  12 years ago
  Beginning Java
  What is the purpose of overriding,overloading and interface?
  For a very good explanation of polymorphism and overriding, including why one might use them, take a look at "How my Dog learned Polymorphism" in
  the JavaRanch Campfire Stories
  . (Note that the "Animal" parent class could just as easily be an interface, with the "Dog" class then implementing the interface, instead of extending the parent class.)
  show more
  12 years ago
  Beginning Java
  how the key-value pair is sorted in ascending and descending order.
  Welcome to JavaRanch, krishnan!
  The API documentation of the TreeMap class is available at
  .
  After reviewing it, as Gavin recommended, do you have any ideas for implementing the descending order functionality? If you're still totally stuck, I'm sure some friendly JavaRanchers would be glad to help nudge you further towards a solution.
  show more
  12 years ago
  Beginning Java
  j2se API download link required
  Short Answer: Use the J2SE 1.4.2 Documentation Download link at
  How I Found This Link: At
  in the "Popular Downloads" section, I clicked on "Java SE" to go to
  the "Java SE Downloads" page
  . From the "Java SE Downloads" page, I browsed to
  the "Previous Releases" page
  . From the "Previous Releases" page, I followed the link for "J2SE 1.4.2 Downloads".
  show more
  12 years ago
  Beginning Java
  timezone issue
  I'm not able to recreate the error you're reporting (even if I change the operating system time and/or timezone), and I wouldn't expect you'd need to adjust for DST, since
  the TimeZone class documentation
  describes that TimeZone "also figures out daylight savings."
  What time zone ID are you using? What's your local time zone?
  What displays for you when you run
  System.out.println(new Date(System.currentTimeMillis()));
  ?
  show more
  12 years ago
  Beginning Java
  hi all....
  Welcome to JavaRanch, John!
  Perhaps where to go next depends somewhat on what you're already familiar with and what you want to accomplish.
  If you're new to programming in general...
  In between chapters while reading those great books, write lots of programs. Hundreds of them.
  Places to find Java programming exercises:
  If you're already a great programmer, then perhaps improving on OOAD (Object-Oriented Analysis and Design) and design patterns understanding, with books like "Head First Design Patterns" and Craig Larman's "Applying UML and Patterns", is the way to go.
  If you want to learn server-side programming, then
  the JavaRanch Cattle Drive
  includes a decent introduction to servlets and JSP's. After this introduction, the next steps might include learning a web application framework like
  Struts
  , or learning more JEE (Java Enterprise Edition) technologies like EJB's.
  If you want to write programs for mobile phones, then jump into J2ME.
  If you want to write desktop programs with pretty GUI's, then maybe dive into Swing.
  Some folks pursue
  certifications
  as a means to focus and organize learning efforts, and to validate understanding.
  Etc... (It's time for me to focus my efforts back onto my work...)
  [ June 12, 2007: Message edited by: Dirk Schreckmann ]
  show more
  12 years ago
  Beginning Java
  string processing
  The API documentation Jesper referred to is available at
  . This documentation is definitely one of a Java developer's
  Super Best Friends
  .
  If you're not yet familiar with using regular expressions in Java, this might be a good time to start learning about them. A decent introduction to this subject is in the two "An Introduction to java.util.regex" articles in
  the JavaRanch Journal
  .
  Way Big Hint ('cuz you got lucky that I was just now writing a regular expression for something else):
  import java.util.regex.Matcher; import java.util.regex.Pattern; public class Foo { public static void main(String[] args) throws Exception { String path = "C:/root/user/home/source/foo.java"; Pattern pattern = Pattern.compile("(.*?/){2}.*?(?=/)"); Matcher matcher = pattern.matcher(path); if (matcher.find()) { System.out.println(matcher.group()); } } }
  [ June 12, 2007: Message edited by: Dirk Schreckmann ]
  show more
  12 years ago
  Beginning Java
  cant understand Y ?
  sudhan,
  Following what Keith explained concerning "passing by value", you might also like to read the "Pass-by-Value Please" story in
  the JavaRanch Campfire Stories
  . This story certainly helped me to understand Java references (and objects) better.
  If you're still not confident in understanding how the example application works, then it may help others to help you, if you were to explain some more details about what you expect the program to do, and how you currently understand what the program actually does.
  show more
  12 years ago
  Beginning Java
  Strings doubt
  Welcome to JavaRanch, Arnav!
  How expressions are evaluated
  by a Java compiler or runtime environment is described within
  The Java Language Specification
  (also known as the JLS, for short). If you're not already familiar and comfortable with this document, as you learn Java, you may find that you soon will be (though it may initially appear to be somewhat intimidating, i.e. technical and boring).
  Different implementations of Java compilers or runtime environments should all adhere to the rules in the JLS (otherwise, I suppose, they'd arguably not be
  Java
  compilers or runtime environments). (Note: The Java language has changed slightly since version 1.0, though I don't presently recall how any of these changes pertain to this conversation.)
  The expression
  7 + 2 + "JP" + 3 + 2
  should be evaluated the same way by all Java compilers and runtime environments.
  The evaluation order
  is especially relevant. As you've likely already discovered, this example expression is evaluated from left to right (and will always evaluate to "10JP32").
  Are the steps of the evaluation of this example expression clear?
  [ June 12, 2007: Message edited by: Dirk Schreckmann ]
  show more
  12 years ago
  Beginning Java