|
What is the problem here?
you just incrementing the integer 'i' for checking condition but the value you intend to print is integer array a[] of size 20.For that you must modify your code into
import java.io.*;
class print
{
public static void main(String[] args)
{
int[] a = new int[20];
int i=0;
while(i<=20)
{
i++;
a[i] = i;
System.out.println(a[i]);
}
}
}
output of above code is :
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<div class="signature">Thanks and Regards,
RK_PRABAKAR</div>
|
|
|
|
|
i need the source code for image encryption in java based on hill cipher.somebody plz help............
|
|
|
|
|
bhanu.pratap.99 wrote: i need the source code
Then you need to go and search for it; this site is not here to provide source code to order.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Go write it then!
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
don't listen to them - I'll give you a jump start: JCA[^]
Have fun.
|
|
|
|
|
|
|
Start here[^] and you will find lots of samples that will help.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Show us your homework and we will contribute some advice.
We will help, but we are not doing your work.
|
|
|
|
|
ya help me by giving some instruction don't do my work it is a request sir not an order
|
|
|
|
|
ok, so here are some of MY requirements:
- Make it a Windows-Service[^] (visible in the bottom right task corner). It should start with the OS and as a first log date time and name of the log in.
- You'll need a KeyListener[^]
- Make the log by log4j[^] -> I want daily log files. (Tutorial[^])
- on request I want a print out[^] in PDF Format[^] (Yes, I know the F stands for "Format" but it sounds wired when one says PD Format).
Let's see what you've got in mind.
|
|
|
|
|
anilgoyal1289 wrote: guys
And why would you want that? It sounds like a key-logger to me, which is bad[tm].
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
naa, I assume he's not working for Apple or Google or Facebook. He's just trying to get a poem displayed in a fancy window. You know that kind of stuff.
|
|
|
|
|
no i am not want to make a keylogger for hacking i am just write a program for security in my computer pls help me
|
|
|
|
|
Hi Guys
I write a program,but i want it remain in the running when i exit program.
in other words,when i close program it not exit really and it work in background,
whit out show any things in screen for example icon and ....
like in c# when we set the thread is background property to false or service in C# program.(in J2ME)
thanks advance.
|
|
|
|
|
overwrite the Window.close() method.
And you can also use a WindowListener to react on the event of closing the window to kick additional actions: Clickedy for a tutorial[^]
in the tutorial you'll also find that you can quite simple modify the closing event to just hide but not close the GUI Frame on a SWING implementation.
To make a Java application to run as a Windows Service is also not complicated: Read this article![^]
|
|
|
|
|
Hi,
How can i maintain connection pool for mutithreaded programs.my team given maxlimit=20 only but here threads are using 15 connections at a time ,so incase the connection not available it will raise the Closed Connection so please help me
|
|
|
|
|
Connections to what?
A common way to do this is to have a wrapper object that shares the connections. if you only need to hold the connection for a single method call it is easy, but if you need to maintain the use of a specific thread for several calls, then you need the concept of a lock, but here is a simple example of a connection pool:
class WrapperClass (
private static PoolClass pool = new PoolClass();
private int calls;
private ConnectionClass connection;
public WrapperClass() {
this.calls = 0;
}
private ConnectionClass getConnection() {
if (this.calls == 0) {
this.connection = WrapperClass.pool.getConnection();
}
this.calls++;
return this.connection;
}
private void releaseConnection() {
this.calls--;
if (this.calls <= 0) {
WrapperClass.pool.releaseConnection(this.connection);
this.connection = null;
this.calls = 0;
}
}
public void startMultipleUse() {
this.getConnection();
}
public void useConnection() {
ConnectionClass c = this.getConnection();
this.releaseConnection();
}
public void endMultipleUse() {
this.releaseConnection();
}
)
Not that externally, the real connection - ConnectionClass - can never be accessed.
The PoolClass just instantiates the list of connections and hands them out on request and puts them back in the list when returned.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
c.thimmaiah wrote: connection pool
First that is non-precise. It could refer to almost anything.
Other than that the idea of a pool is to manage connections responsibly based on the client and server.
Obviously your real problem is that this is not correctly designed for in your system.
Some pools allow various configurable ways to deal with pool exhaustion, one is to throw an exception the other is to block until a connection is free.
Keep in mind that if your client code is holding on to connections for longer than needed then that too is a problem. 15 connections used well should be able to handle a substantial number of client requests. Additionally other design techniques such as caching should be used for heavy duty database resources.
And presumably the problem isn't just that some code is not actually returning the connection to the pool and instead is relying on the garbage collector to do it.
|
|
|
|
|
I'm teaching myself Java with one of the "Teach Yourself Java..." books, and I'm up to the chapter on Threads. I want to be sure I understand the concept properly. Is it safe to say that
first you start the thread
which then calls the run() method
which houses the actual method you want to be threaded?
Please let me know if I have this concept correct. Thanks
Dre---
|
|
|
|
|
correct.
|
|
|
|
|
Hi,
I've an aplication client-server, and I need to do an event in the client when one variable is modified in the server. it is posible???
I know that in the server or in the client is posible with propertychangelistener, but I don't know if it is posible by this way and how can I do it.
Thank you, so much
|
|
|
|
|
|
If I understood good your answer, I can't implement this, becouse I receive the comunication when the client press a button, but this button only press one client, and not all the client. However, to finish the program I need send an message to all client, but if only press the button one client only receive the message this client and not all.
Thank you so much, if I wrong, please check me
|
|
|
|
|
There is no reason this can not work, it does on a lot of software.
Is the sequence this:
0. A client initiates an action.
1. The action is sent to the server for processing.
2. All clients receive an update with the result.
This is a very simple pattern, think live chat rooms via instant messaging.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|