[java ee programming] String format do not return foat!!
Problem with String.format which it expected to display the information. The getChargePerDay and getMaxCharge are not display when it return. I doubt what is the problem. return String.format("%-30s $%5.2f $%7.2f %4$tm/%4$td/%4$ty", getTitle(), getChargePerDay(), getMaxCharge(), dueDate.getTime()); Thank you, -- You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
[java ee programming] String Buffer multipel values
How to get multiple values in StringBuffer object or array from result set? What i want to do is, want to access values from data base and show into select tag. For example:- ResultSet rs; while (rs.next()) { //Access value into String buffer array/object } and show into <%=value%> earlier I was using array. but it is not grow able. so i want to use String Buffer. Can any one tell how can i achieved this . Thanks in Advance!! Regards Sagar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~--~~~~--~~--~--~---
[java ee programming] string
class test { public static void main(String args[]) { String x1 = "abc"; String x2 = "ab"; x2 = x2 + "c"; System.out.println(x1==x2); } } why does it print false? in this case 3 objects will be formed in the string pool and they will be ("abc"),("ab").("c")and both the refrences x1,x2 will point to ("abc") i concluded this from -> To make Java more memory efficient, the JVM sets aside a special area of memory called the “String constant pool.” When the compiler encounters a String literal, it checks the pool to see if an identical String already exists. If a match is found, the reference to the new literal is directed to the existing String, and no new String literal object is created. Please tell me whats the flaw in what i am thinking Thanks&Regards --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~--~~~~--~~--~--~---
[java ee programming] string
class test { public static void main(String args[]) { String x1 = "abc"; String x2 = "ab"; x2 = x2 + "c"; System.out.println(x1==x2); } } why does it print false? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~--~~~~--~~--~--~---