Click here to Skip to main content
15,902,275 members
Home / Discussions / Java
   

Java

 
AnswerRe: How to know user still connect to my website in local network ? Pin
jschell29-Aug-11 9:10
jschell29-Aug-11 9:10 
Questioni got java.lang.NullPointerException error while delteing and adding new data inms access DB-pls guide me to solve Pin
jpljayapal27-Aug-11 8:42
jpljayapal27-Aug-11 8:42 
AnswerRe: i got java.lang.NullPointerException error while delteing and adding new data inms access DB-pls guide me to solve Pin
jschell28-Aug-11 8:08
jschell28-Aug-11 8:08 
QuestionComputer talks to u Pin
Had12327-Aug-11 5:48
Had12327-Aug-11 5:48 
AnswerRe: Computer talks to u Pin
Smithers-Jones27-Aug-11 23:48
Smithers-Jones27-Aug-11 23:48 
QuestionGetting the lowest values in one array, and then counting them. Pin
Tor Danielsen25-Aug-11 7:27
Tor Danielsen25-Aug-11 7:27 
AnswerRe: Getting the lowest values in one array, and then counting them. Pin
AspDotNetDev25-Aug-11 8:46
protectorAspDotNetDev25-Aug-11 8:46 
GeneralRe: Getting the lowest values in one array, and then counting them. Pin
Tor Danielsen25-Aug-11 10:25
Tor Danielsen25-Aug-11 10:25 
Thanks for the fast and great reply.

I was just fast translating from Norwegian to English and also changing some words. So it all was way out of context but your example helped me to nail it. the finished code looks like
Java
// Oppgave 7.4.1 start

	public int finnMaksDager() {
		int maksDager = 0;
		int sum = 0;
		for(int i=0; i<nedbør.length; i++) {
			if(nedbør[i] == maksDager) {
				sum++;
			}

			if(nedbør[i] > maksDager) {
				maksDager = nedbør[i];
				sum = 1;
			}

		}
		return sum;

	}

// Oppgave 7.4.1 Slutt



and with
Java
int[] nedbør = {1,4,8,4,3,8,4,8,6,7,4};


it will filter out the highest number in this case 8, and then return the number 3 for that is how many 8's there is in that array.
Regards
-Tor

Questionsound in java Pin
Mhmud emam24-Aug-11 19:48
Mhmud emam24-Aug-11 19:48 
AnswerRe: sound in java Pin
Firo Atrum Ventus24-Aug-11 19:55
Firo Atrum Ventus24-Aug-11 19:55 
QuestionCPU usage per process Pin
kartikdasani22-Aug-11 1:42
kartikdasani22-Aug-11 1:42 
AnswerRe: CPU usage per process Pin
Richard MacCutchan22-Aug-11 2:20
mveRichard MacCutchan22-Aug-11 2:20 
AnswerRe: CPU usage per process Pin
jschell22-Aug-11 9:33
jschell22-Aug-11 9:33 
GeneralRe: CPU usage per process Pin
David Skelly22-Aug-11 22:01
David Skelly22-Aug-11 22:01 
Questionstegnography in java Pin
ROHIT_BHATIA21-Aug-11 8:00
ROHIT_BHATIA21-Aug-11 8:00 
AnswerRe: stegnography in java Pin
David Skelly21-Aug-11 22:00
David Skelly21-Aug-11 22:00 
AnswerRe: stegnography in java Pin
Manfred Rudolf Bihy22-Aug-11 3:53
professionalManfred Rudolf Bihy22-Aug-11 3:53 
QuestionJava Applet not drawing to screen [modified] Pin
Liam S. Crouch20-Aug-11 4:33
Liam S. Crouch20-Aug-11 4:33 
AnswerRe: Java Applet not drawing to screen Pin
Richard MacCutchan20-Aug-11 6:41
mveRichard MacCutchan20-Aug-11 6:41 
GeneralRe: Java Applet not drawing to screen Pin
Liam S. Crouch20-Aug-11 7:44
Liam S. Crouch20-Aug-11 7:44 
GeneralRe: Java Applet not drawing to screen Pin
Richard MacCutchan20-Aug-11 23:28
mveRichard MacCutchan20-Aug-11 23:28 
GeneralRe: Java Applet not drawing to screen Pin
Richard MacCutchan21-Aug-11 8:18
mveRichard MacCutchan21-Aug-11 8:18 
QuestionHow to save the state of applet after changes on webpage? Pin
CodeGust17-Aug-11 15:35
CodeGust17-Aug-11 15:35 
AnswerRe: How to save the state of applet after changes on webpage? Pin
Peter_in_278017-Aug-11 15:49
professionalPeter_in_278017-Aug-11 15:49 
QuestionJava webserver : how to serve applets Pin
Roysten181817-Aug-11 11:43
Roysten181817-Aug-11 11:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.