Forum: Java Dec 10th, 2008 |
| Replies: 4 Views: 2,090 public static boolean INSERT(Payment argPayment, Connection con) {
boolean result = false;
Connection mastercon = MyConnection.getMasterConnection();
try {
// ... |
Forum: Java Jun 7th, 2008 |
| Replies: 1 Views: 493 you can compute it by dividing by 100 (removes the last 2 digits) and then mod'ing by 10 (only keeps the last digit)
(x / 100) % 10 |
Forum: Java Jun 3rd, 2008 |
| Replies: 3 Views: 513 Reflection. you need it when you want to invoke a method by reflection. A method does not have to be public to be invoked. However, you will need to know how to get it. (Class.getMethod() will not... |
Forum: Java May 18th, 2008 |
| Replies: 11 Views: 4,975 Yes, they are called "reference types". The references point to objects.
.
You mean that you cannot have objects as values, then yes.
Yes, they are called primitive types.
Basically.... |
Forum: Java May 2nd, 2008 |
| Replies: 4 Views: 3,377 No. You compile it once to .class files. Then you run the .class files with "java MyClass". |
Forum: Java Apr 26th, 2008 |
| Replies: 7 Views: 874 you could either get all the digits out into a list or something, and then parse them back into a number in reverse
or just take the input as a string and reverse the string |
Forum: Java Apr 25th, 2008 |
| Replies: 2 Views: 686 why don't you post code that actually compiles? |
Forum: Java Apr 23rd, 2008 |
| Replies: 17 Views: 1,713 why don't you post the exception and stack trace, and post the code inside code tags |
Forum: Java Apr 19th, 2008 |
| Replies: 6 Views: 3,516 Well are you using Generics? Maybe you should.
http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html |
Forum: Java Apr 15th, 2008 |
| Replies: 4 Views: 490 in java objects are always referred to using "references", which are kind of like pointers in C, except that you can't do silly stuff with them |
Forum: Java Apr 14th, 2008 |
| Replies: 6 Views: 764 can we see more code? for example, what types are all these things? how are they defined? |
Forum: Java Apr 13th, 2008 |
| Replies: 6 Views: 764 This line makes no sense; you are getting the value that is associated with the key "info", and then you are testing whether that value is a key in the hash table? |
Forum: Java Apr 13th, 2008 |
| Replies: 3 Views: 2,621 |
Forum: Java Apr 11th, 2008 |
| Replies: 3 Views: 1,197 um... where is your code? |
Forum: Java Apr 11th, 2008 |
| Replies: 2 Views: 3,395 x.multiply(y)
why don't you show us what your problems are |
Forum: Java Apr 10th, 2008 |
| Replies: 2 Views: 488 http://en.wikipedia.org/wiki/Hash_table |
Forum: Java Apr 8th, 2008 |
| Replies: 4 Views: 489 so lets look at line 112:
truckinfo[i].Set(inputhp, inputmileage, inputyear);
The two references that you dereference in that line are "truckinfo" and "truckinfo[i]". "truckinfo" isn't null... |
Forum: Java Apr 8th, 2008 |
| Replies: 8 Views: 4,533 but that doesn't insert it in the right place |
Forum: Java Apr 5th, 2008 |
| Replies: 4 Views: 545 inner classes are nice because they can implicitly access the fields of the enclosing instance, so if your buttons were pointed to by a field, then you can use an inner class to access them |
Forum: Java Apr 3rd, 2008 |
| Replies: 3 Views: 540 yes, use Iterator if possible |
Forum: Java Mar 27th, 2008 |
| Replies: 9 Views: 1,048 um.. so for starters, you know that you can only put code in methods? you can't have statements randomly outside methods |
Forum: Java Mar 27th, 2008 |
| Replies: 9 Views: 1,048 it appears to be an applet. you usually have to embed the applet in an HTML page using applet tags and use a browser to run it |
Forum: Java Mar 27th, 2008 |
| Replies: 15 Views: 3,166 you should have
int starB=10;
inside the outer while loop |
Forum: Java Mar 20th, 2008 |
| Replies: 11 Views: 1,166 do you mean, "it doesn't compile"? there are no classes named Widget, Spork, or Grommet; how do you expect to create new objects of those classes? |
Forum: Java Mar 17th, 2008 |
| Replies: 4 Views: 801 can you post your entire code? |
Forum: Java Mar 15th, 2008 |
| Replies: 8 Views: 943 yes. (except that in Java the first object is garbage-collected and in C++ it isn't) |
Forum: Java Mar 14th, 2008 |
| Replies: 8 Views: 943 you should read a basic guide to Java
Java consists only of primitive types and reference types (which are kind of like pointers in C). Reference types point to objects, and are named after the... |
Forum: Java Mar 14th, 2008 |
| Replies: 2 Views: 2,443 "b" and "c" are references (like the previous poster said, kind of like pointers in C) which may point to objects. objects are not values in java; instead, you always manipulate them through... |
Forum: Java Mar 12th, 2008 |
| Replies: 3 Views: 776 um... you have random code outside of a method, in the declaration of class "carinfo" |
Forum: Java Mar 12th, 2008 |
| Replies: 4 Views: 1,385 what exactly is your question?
why can't the classes be separate and you just put each class in its own file?
also the "main" method should be static |
Forum: Java Mar 9th, 2008 |
| Replies: 4 Views: 629 if you really want to know, the members of an array are specified in JLS 10.7 (http://java.sun.com/docs/books/jls/third_edition/html/arrays.html#10.7) |
Forum: Java Mar 6th, 2008 |
| Replies: 5 Views: 914 i think something's actually wrong with your logic. i can't see your code, so I don't know what methods like getIndex(), setChild(), and stuff do; but... your recursion only stops if i == m, where i... |
Forum: Java Mar 6th, 2008 |
| Replies: 5 Views: 914 it's really hard to tell what you are doing without seeing some code
in your "tree", do the nodes have references to their children; if so, then the children are not garbage collected, because... |
Forum: Java Mar 5th, 2008 |
| Replies: 8 Views: 665 your remove() method doesn't have a closing brace
perhaps this has to do with your two opening braces after the if |
Forum: Java Mar 5th, 2008 |
| Replies: 6 Views: 1,980 it's not security (there are ways to get access to private fields and methods anyway), it's called abstraction
the idea is that if people can access stuff, then they will write code which will... |
Forum: Java Mar 3rd, 2008 |
| Replies: 1 Views: 438 isn't it printed out by your program? |
Forum: Java Mar 1st, 2008 |
| Replies: 8 Views: 1,152 your add(), subtract(), multiply(), and divide() methods modify their arguments, without changing them back; i am not sure if this is what you want
i don't understand your reduce() method. it... |
Forum: Java Feb 24th, 2008 |
| Replies: 3 Views: 5,278 one reason why you might want to & 0xFF is that byte's are signed, so if "data" is a byte array, and some of the bytes are 128 or above, then they will be interpreted as being negative. and when they... |
Forum: Java Feb 23rd, 2008 |
| Replies: 4 Views: 1,188 what is "execution via a webpage"? |