Core java
23 December[Fixed] Error: Identifier expected in java
Learn about how to fix error Identifier expected in java in multiple ways.
22 December[Fixed] bad operand types for binary operator in java
Learn about how to resolve bad operand types for binary operator in java.
22 DecemberHow to Add Days to Date in Java
Learn about how to add days to Date using Calendar and LocalDate in java.
07 DecemberHow to set java path in windows 10
In this post, we will see about how to set java path in windows 10 using cmd. To set java path, you need to first understand about JAVA_HOME and how to set JAVA_HOME in windows 10. Let’s first understand about JAVA_HOME and then we will see how to set JAVA_HOME in windows 10. What is […]
06 DecemberDifference between replace() and replaceAll() in java
In this post, we will see difference between String’s replace() and replaceAll() methods in java. String’s replace() and replaceAll() both replace all occurences in the String. String’s replace() takes either two chars or two CharSequences as arguments and it will replace all occurrences of char or String but replaceAll() method takes regex String as argument […]
18 NovemberConvert LocalDateTime to Timestamp in Java
In this post, we will how to convert LocalDateTime to Timestamp . Before learning how to convert localdatetime to timestamp, let us learn about LocalDateTime and Timestamp, and understand the importance of this conversion. LocalDateTime LocalDateTime was introcuded in Java 8. LocalDateTime can be imported time package: import java.time.LocalDateTime; LocalDateTime is an immutable object used […]
12 OctoberJava 9 JShell tutorial
The Java JShell is a command-line tool that is introduced in Java 9 version. It helps to execute/test Java statements in a single line. It is based on REPL (Read Evaluate Print Loop) that reads a code statement, execute that and print the output, statement after statement. It reads the statement and immediately shows the […]
11 OctoberJava 9: Stream API Improvements
In Java 9, following methods are added to Stream interface of stream package. These methods are default and static. The takeWhile() Method This method is included in Stream interface and used to collect the elements into a stream. It takes all the elements till the condition specified as predicate. For example, we want to collect […]