Click here to Skip to main content
14,491,507 members
   

Java

 
GeneralRe: any one has idea about how to get memory usage of remote server using java? Pin
Member 136650076-Feb-18 18:07
MemberMember 136650076-Feb-18 18:07 
QuestionSigar API Pin
Member 1363596721-Jan-18 18:13
MemberMember 1363596721-Jan-18 18:13 
QuestionRe: Sigar API Pin
Richard MacCutchan21-Jan-18 21:59
mveRichard MacCutchan21-Jan-18 21:59 
AnswerRe: Sigar API Pin
Member 1363596722-Jan-18 17:24
MemberMember 1363596722-Jan-18 17:24 
GeneralRe: Sigar API Pin
Richard MacCutchan22-Jan-18 21:36
mveRichard MacCutchan22-Jan-18 21:36 
GeneralRe: Sigar API Pin
Member 1363596722-Jan-18 21:37
MemberMember 1363596722-Jan-18 21:37 
QuestionFind and query files in a directory in date format yyymmdd Pin
hm916-Jan-18 22:45
Memberhm916-Jan-18 22:45 
AnswerRe: Find and query files in a directory in date format yyymmdd Pin
jschell17-Jan-18 14:29
Memberjschell17-Jan-18 14:29 
AnswerRe: Find and query files in a directory in date format yyymmdd Pin
Richard MacCutchan17-Jan-18 21:56
mveRichard MacCutchan17-Jan-18 21:56 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
hm917-Jan-18 23:13
Memberhm917-Jan-18 23:13 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
Richard MacCutchan17-Jan-18 23:16
mveRichard MacCutchan17-Jan-18 23:16 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
hm917-Jan-18 23:29
Memberhm917-Jan-18 23:29 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
Richard MacCutchan17-Jan-18 23:32
mveRichard MacCutchan17-Jan-18 23:32 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
hm917-Jan-18 23:59
Memberhm917-Jan-18 23:59 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
Richard MacCutchan18-Jan-18 0:32
mveRichard MacCutchan18-Jan-18 0:32 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
hm918-Jan-18 1:29
Memberhm918-Jan-18 1:29 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
Richard MacCutchan18-Jan-18 1:45
mveRichard MacCutchan18-Jan-18 1:45 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
hm918-Jan-18 1:55
Memberhm918-Jan-18 1:55 
GeneralRe: Find and query files in a directory in date format yyymmdd Pin
Richard MacCutchan18-Jan-18 2:54
mveRichard MacCutchan18-Jan-18 2:54 
QuestionWhat is wrong with this java code, why is it not printing Factorial? Pin
Member 1362428615-Jan-18 10:02
MemberMember 1362428615-Jan-18 10:02 
AnswerRe: What is wrong with this java code, why is it not printing Fibonacci? Pin
Richard MacCutchan15-Jan-18 21:45
mveRichard MacCutchan15-Jan-18 21:45 
GeneralRe: What is wrong with this java code, why is it not printing Fibonacci? Pin
Member 1362428616-Jan-18 2:07
MemberMember 1362428616-Jan-18 2:07 
GeneralRe: What is wrong with this java code, why is it not printing Fibonacci? Pin
Richard Deeming16-Jan-18 3:07
mveRichard Deeming16-Jan-18 3:07 
AnswerRe: What is wrong with this java code, why is it not printing Factorial? Pin
vishaljamdagni29-Jan-18 18:58
professionalvishaljamdagni29-Jan-18 18:58 
Maybe you shouldn't give the factorial of 1 the value 2 as it is returning in your first "if" construct. Now I am not expert but I think this should work:

public class facto{
    public static void main(String[] args){
        System.out.println(dust(5));
    }

static int dust(int n)
   {
       int output;
       if(n==1){
         return 1;
       }
       
       output = dust(n-1)* n;
       return output;
   }
}


I suppose that in your version the recursion is not able to complete properly because of "maybe" your trying to both return the value and calculate it at the same time. Hope the code snippet helps, I am just a beginner myself so apologies if I didn't get it right. P.S I know I haven't considered the condition of the input being 0.

modified 8-Feb-18 1:12am.

QuestionJava Array Out Of Bound Issue Pin
Akshit Gupta13-Jan-18 5:50
MemberAkshit Gupta13-Jan-18 5:50 

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.