Click here to Skip to main content
14,357,409 members
   

Java

 
GeneralRe: how to protect jar file from decompilation Pin
jschell17-Mar-18 7:16
memberjschell17-Mar-18 7:16 
GeneralRe: how to protect jar file from decompilation Pin
Renu Meena18-Mar-18 21:35
memberRenu Meena18-Mar-18 21:35 
Questionproblem in implementing isPalindrome() by using java collections.reverse Pin
ElenaRez12-Mar-18 10:41
memberElenaRez12-Mar-18 10:41 
SuggestionRe: problem in implementing isPalindrome() by using java collections.reverse Pin
Richard MacCutchan12-Mar-18 10:55
protectorRichard MacCutchan12-Mar-18 10:55 
GeneralRe: problem in implementing isPalindrome() by using java collections.reverse Pin
ElenaRez12-Mar-18 12:33
memberElenaRez12-Mar-18 12:33 
GeneralRe: problem in implementing isPalindrome() by using java collections.reverse Pin
Richard MacCutchan12-Mar-18 23:54
protectorRichard MacCutchan12-Mar-18 23:54 
GeneralRe: problem in implementing isPalindrome() by using java collections.reverse Pin
ElenaRez13-Mar-18 11:23
memberElenaRez13-Mar-18 11:23 
QuestionOutOfMemoryError exception while pushing in the stack Pin
Elenora4-Mar-18 6:02
memberElenora4-Mar-18 6:02 
Hello. I have written a code like below for Valid Parentheses problem. and after running it, I get error such: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space in the line where I push in the stack. Could any one help what is the problem?

class Solution {
    public boolean isValid(String s) {
        Stack<Character> stack = new Stack<Character>();
        int i=0;
        boolean result=false;
        if(s.length()==0||s==null) return true;
        while(i<s.length()){
            if(s.charAt(i)=='('||s.charAt(i)=='{'||s.charAt(i)=='[')
                stack.push(s.charAt(i));
            if((!stack.empty())&&(s.charAt(i)==')'||s.charAt(i)=='}'||s.charAt(i)==']')){
                if(stack.peek()==s.charAt(i)){
                    stack.pop();
                    i++;
                    continue;
                }
                else
                    result=false;
            }
                
        }
        if(stack.empty())
            return true;
        return result;
    }
}

AnswerRe: OutOfMemoryError exception while pushing in the stack Pin
Richard MacCutchan4-Mar-18 7:32
protectorRichard MacCutchan4-Mar-18 7:32 
AnswerRe: OutOfMemoryError exception while pushing in the stack Pin
Luc Pattyn4-Mar-18 9:27
professionalLuc Pattyn4-Mar-18 9:27 
AnswerRe: OutOfMemoryError exception while pushing in the stack Pin
jschell10-Mar-18 11:23
memberjschell10-Mar-18 11:23 
Questionhow i encryt the file by aes need some help Pin
SHUBHAM KHANDAR4-Mar-18 5:56
memberSHUBHAM KHANDAR4-Mar-18 5:56 
AnswerRe: how i encryt the file by aes need some help Pin
Richard MacCutchan4-Mar-18 7:22
protectorRichard MacCutchan4-Mar-18 7:22 
QuestionJava Breakout via MVC Pattern Pin
Rautap28-Feb-18 12:53
memberRautap28-Feb-18 12:53 
QuestionBetweennessCentrality Pin
Member 1369070822-Feb-18 0:35
memberMember 1369070822-Feb-18 0:35 
RantRe: BetweennessCentrality Pin
Richard Deeming22-Feb-18 1:39
mveRichard Deeming22-Feb-18 1:39 
GeneralRe: BetweennessCentrality Pin
jschell23-Feb-18 14:42
memberjschell23-Feb-18 14:42 
QuestionWeather Java application Pin
Member 1367572517-Feb-18 4:20
memberMember 1367572517-Feb-18 4:20 
AnswerRe: Weather Java application Pin
Richard MacCutchan17-Feb-18 5:01
protectorRichard MacCutchan17-Feb-18 5:01 
AnswerRe: Weather Java application Pin
jschell17-Feb-18 12:44
memberjschell17-Feb-18 12:44 
AnswerRe: Weather Java application Pin
Lshadown19-Feb-18 9:30
memberLshadown19-Feb-18 9:30 
QuestionFor loops, how to jump back to the start of the loop efficiently? Pin
IrishCoder9916-Feb-18 12:39
memberIrishCoder9916-Feb-18 12:39 
AnswerRe: For loops, how to jump back to the start of the loop efficiently? Pin
phil.o16-Feb-18 13:07
mvephil.o16-Feb-18 13:07 
GeneralRe: For loops, how to jump back to the start of the loop efficiently? Pin
IrishCoder9916-Feb-18 13:52
memberIrishCoder9916-Feb-18 13:52 
GeneralRe: For loops, how to jump back to the start of the loop efficiently? Pin
phil.o16-Feb-18 13:53
mvephil.o16-Feb-18 13:53 

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.