Static Methods in Java

Similar Posts

  • Java Sets

    While we didn’t look at creating a Set, we could have with several of the data structures we built – such as the binary tree if we didn’t allow duplicate data, or by searching our linked list before adding the element. It turns out that Java doesn’t provide a single Set type, but actually multiple…

  • Loops in Java

    Loops in Java work similarly to how you remember loops in C/C++ most likely. You have your counting loop (for), as well as your pretest conditional loop (while), and the conditional post test loop (do-while). Each of these work the same way you would expect them to in C/C++. For Loop The for loop is…

  • Java Stacks

    The Stack class is found in java.util and it extends the Vector Class. This means it can grow and shrink as needed, which is helpful for a Stack. As it extends a Vector, it is helpful to Parameterize the constructor. Just like the Stack that we’ve created, it has the same methods: push(), pop(), and…

  • Console Inputs in Java

    Reading from the console is something that most people learn to do in a single line or two of code in most languages. However, Java is not most languages… Consider Python: C++ Java So what is going on with that? System.in So lets start with the System.in. This is the console input stream object, just…