What do you want to save?
Add Code snippet
New code examples in category Java
-
Rayan Ahmed 2021-08-28 13:41:01
difference between hashmap and map java
Hash map: -> It is the implementation of map interface. -> It can contain null values and keys. -> It doesn't maintain input order. Map: -> It is an interface -> Map has two implementation -> Tree Map -> Hash Map -> Tr... Add solution -
Andre Doubois 2021-08-28 13:31:02
what is the difference between sc.nextLine() and sc.next() in java
Their differences are... next() can read the input only till the space. It can't read two words separated by space. Also, next() places the cursor in the same line after reading the input. nextLine() reads input including space between the words (that i... Add solution -
-
Dboggs95 2021-08-28 09:21:01
java nth fibonacci number
// Using following formula you can find nth Fibonacci Number without using any loops; // Created by using resources from " https://math.hmc.edu/funfacts/fibonacci-number-formula/ " class Find { public int nFibo(int n) { double P... Add solution -
Hjk92 2021-08-28 07:32:02
stack class in java
// construct with non-primative elements only! Stack<String> stack = new Stack<String>(); // to add a value to the top of the stack: stack.push("Hello"); // to return and remove a value from the top: String top = stack.pop(); // t... Add solution