Search:

Type: Posts; User: CodeBro

Search: Search took 0.11 seconds.

  1. Re: Why does my code throw an exception when there aren't square brackets around the delimiter for the String split method?

    The statement at line 8 is:

    String[] array2 = str2.split("?", 0);
  2. Re: Why does my code throw an exception when there aren't square brackets around the delimiter for the String split method?

    Here is the program:



    import java.util.Arrays;
    public class Program {
    public static void main(String[] args) {
    String str = "22-22";
    String str2 = "33?33";
    String str3 = "12,12";
  3. Re: Why does my code throw an exception when there aren't square brackets around the delimiter for the String split method?

    This is the full error message:



    Exception in thread "AWT-EventQueue-0" java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0
    +-x/doubleintarclg
    ^
    at...
  4. Why does my code throw an exception when there aren't square brackets around the delimiter for the String split method?

    I am currently trying to make a calculator in Java. I want to use the String split method to tokenize the string of characters inputted. I thought I was using the String split method wrongly, because...
  5. Replies
    1
    Views
    1,360

    Why does my calculator only return 0.0?

    I am making a calculator in Java. However, when I press the "=" button on my calculator, it always returns 0.0, no matter what. I don't understand why? The code is below:



    import...
  6. How do I prevent these exceptions from occurring?

    I am trying to make a calculator in Java. I have made much progress so far, but when the equal button is pressed when I try to do a calculation in the calculator, nothing happens and error messages...
  7. Replies
    2
    Views
    1,201

    Help With ActionListener

    Hello. I am trying to make a calculator using Java GUI. I've managed to make an ActionListener and add it to a button, but I've made an error in my code that I'm unsure of how to solve. Because of...
  8. Thread: Hello Everyone

    by CodeBro
    Replies
    2
    Views
    826

    Hello Everyone

    Hi, guys! I am CodeBro. I've learned a few languages, HTML, CSS, some Javascript, and Java. I have a website where I review games. I am also recording myself playing games to promote my website. I...
Results 1 to 8 of 8