I have this program, I get the right answer but it does not do the right stuff, I'm supposed to take the SumOfN takes an int n as a parameter and returns the sum ofN, Method does not do this,

Your program should loop, ask for n, if N > 0, Calculate and Print sumofN
if N <= 0, stop
I've been working on this for 3 meesly hours and can't figure it out, pleaseeee help, So frustrated.

import java.util.*;
public class sumOfN {
public static int sumOfN(int n) {
return n;
// main(): application entry point
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
int count = 0;
int sum = 0;
System.out.println("Please enter an integer: ");
int n = stdin.nextInt();
//Return for zero and negative numbers
if (n <= 0) {
//Calculate integer Value
for (count = n; count > 0; count--) {
sum += count;
//Print user input in an output form
System.out.println("SumOfN(" + n + ") has an integer value of " + sum);