[Solved] pulling data from txt file getting java.lang.Arrayindexoutofboundsexception errors

so i figured out the fix to the ArrayIndexOutOfBounds errors and got it to work. The only remaining issue with the above programs is that answering question 4 (survivors by class). Here’s the code for that portion of the Titanic.java class that works: /** * Number of passengers who survived the sinking of the Titanic … Read more

[Solved] Refactor code java [closed]

I work under the assumption that you have several constants like Group.GROUP_TYPE_NAME_HYDRO, and all your methods are just like the one you show us, but with different constants (I believe you should add those other methods to your question, since without them there is no visible repeated code). You have two possible scenarios (again, with … Read more

[Solved] Java – Can I concatenate a String with a lambda? How?

yshavit: What you’re trying to do isn’t easy/natural to do in Java. You’re basically trying to write an expression which creates and immediately invokes a method, basically as a way of grouping a bunch of statements together (and also providing an enclosed scope) to get a single value. It’s not an unreasonable thing, and in … Read more

[Solved] cannot find symbol : class java.awt.graphics [duplicate]

drawString is a method and not a variable. So you need to pass the parameters to method instead of assigning them. You need to change this: objG.drawString=”strString 1,202,42″; to: objG.drawString(strString1,202,42); 7 solved cannot find symbol : class java.awt.graphics [duplicate]

[Solved] why apache servlet is singleton? [duplicate]

Its an issue and it is never advisable to declare HttpServletRequest request/HttpServletResponse response as an instance variable. Actually Servlet is implementing single thread model that means only one servlet instance is created. And one thread for each request. So if their are many requests then thr must be many threads and each sharing same servlet … Read more

[Solved] Transform Date to JSON

The seems like the date/time wire format used in WCF. From MSDN it states: DateTime values appear as JSON strings in the form of “/Date(700000+0500)/”, where the first number (700000 in the example provided) is the number of milliseconds in the GMT time zone, regular (non-daylight savings) time since midnight, January 1, 1970. The number … Read more