|
for(Record r : yourArrayList)
{
printf("Name:%s\tAddress:%s\tBalance:%d\n",r.name,r.address,r.balance);
}
Note:i suppose that balance is integer so i used the "%d" format.
|
|
|
|
|
yes, but which class to import? it shows an error saying that it can not find printf() method in java.lang.String, though i have also included the java.util.*modified on Saturday, March 13, 2010 2:28 AM
modified on Saturday, March 13, 2010 2:31 AM
|
|
|
|
|
Did you read my previous reply? txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
i did....and implemented it successfully as well. thanx.......
|
|
|
|
|
My apologies, but printf() is part of PrintWriter and may be accessed through System.out .txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Please give any the reason that how it works?????
|
|
|
|
|
with the normal try/catch mechanismus. This exception should only get thrown if you allocate real hughe memory blocks ( maybe > 1 GB). If that fails your program isnt dead enough... Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
The same way you catch any exception is the short answer. However, if you have an OutOfMemory condition then chances are that nothing (including catching the exception) will be possible any longer. In many cases your entire system will stop working for a while at least. Further details can be found here[^]. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Richard MacCutchan wrote: The same way you catch any exception is the short answer
Out Of Memory is an Error, not an Exception. You need to catch either Error or Throwable for this, catching Exception won't work.
|
|
|
|
|
Well he asked how to catch it; the answer is in a catch() statement. I did not specify catch(Exception) in my answer, but left it to the questioner to check the details.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hello friends
I am new to java3D so I installed j3d .
After that i cameto know abt jgl.
So i want to know that can I use both Libraries ?
If not then Is jgl easier than j3d to load 3d objects on web.
And one more jgl classses are quite same as j3d or totally different?
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
Hi
I am comparing possibilities for creating custom design surfaces (forms designer) for a course at university.
Example in C# WinForms: Have a Great DesignTime Experience with a Powerful DesignSurface (Extended) Class[^]
Is something like that possible in Java as well (i think so ).
Do you know any examples/tutorials/references where I can find some information about it?
If you know any examples besides Java and C# WinForms I would appreciate it if you'll let me know.
Thank you
|
|
|
|
|
Try a Google search, there are hundreds of Java tutorials on the web. The Java Tutorials[^] home page has a number to get you started. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Maybe you've misunderstood my intention of my question.
I am not looking for java programming tutorials or building simple Guis.
I am more looking for creating my own "Gui Builder" and if there a references, guidelines or tutorial for this case.
I've found GEF (Graphical Editing Framework) (http://www.eclipse.org/gef/overview.html[^]), I think this could help
|
|
|
|
|
akamper wrote: I am more looking for creating my own "Gui Builder"
Which is the same thing; and I'm pleased that you took my advice and searched for it.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
You might also want to take a look at NetBean's Gui designer (Matisse). It is open source and you can download the source code from the NetBeans site to see how it works or to extend it and add in your own features if you want.
|
|
|
|
|
Or you could look at the Abeille forms designer which takes a different approach to the same problem and which is also open source.
https://abeille.dev.java.net/[^]
|
|
|
|
|
Hi,
My coming project is to provide streaming data in stock market.
Currently, we are using request and response method in HTTP.
I read some company can provide streaming data smoothly by Java applet.
Can you have any reference or design guideline for me to implement it?
Thanks.
John
|
|
|
|
|
Have a look at UDP, you will need to use this for the majority of your message content and then use TCP fpr handshakes and checksums.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
Thanks for your idea.
However, it seems that UDP cannot guarantee the correctness of data.
Is there any standard format for data streaming?
|
|
|
|
|
Try here[^] for explanations of what you can do with Java. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
KenKen Wong wrote: I read some company can provide streaming data smoothly by Java applet.
Well that would be a good place to ask your question, as they can probably explain what format the data comes in.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hello guys....have you ever thought to call main() in another mathod of the same class...let me show an example
class A {
public static void main(String [] args) {
some code here....
}
public void someMethod() {
here i want to call main()
}
}
Can we do that?? Basically im trying to simulate ATM Machine on Console...and you know we need to go back to original MENU when we are done with some transaction.
|
|
|
|
|
This is the wrong way to do it. Use your main() method to drive the application. If you need some function to execute repeatedly then either call it (if static) direct from main, or create a new object of the class and call its method(s) within some control loop. So in your sample above main() should create a new object of class A and repeatedly call someMethod() .txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
I would prefer to go further:
ALLWAYS create another object in your main and work from the object or deeper.
Maybe this can help you too:
recursion ^
greets
TorstenI never finish anyth...
|
|
|
|