Preparing for Java and Spring Boot Interview?

Join my Newsletter, its FREE

Saturday, July 30, 2022

How to become Blockchain Architect in 2024? Is Blockchain Architecture Certification by 101 Blockchains worth it?

Blockchain solutions have been making a lot of noise in the tech space recently for all the right reasons. It comes with the advantage of decentralization, security, and transparency. At the same time, you can also notice the possibility of a growing ecosystem of use cases. A Certified Enterprise Blockchain Architect can serve as a promising asset for enterprises in the present times. How? The work of an architect focuses on designing blockchain solutions by evaluating the requirements of the specific use case.

How to learn Metaverse from scratch? Is Certified Metaverse Professional (CMP) on 101 Blockchains worth it

Is Certified Metaverse Professional (CMP) on 101 Blockchains worth it?
Hello guys, if you want to learn Metaverse in 2022 and wondering how to learn Metaverse then you have come to the right place. Earlier, I have shared best Metaverse online courses and in this article, I am going to review one of the popular Metaverse certification, The certified Metaverse Professional certification from 101 Blockchains, one of the leading portal for Blockchain, Web3, NFT, and Metaverse training. The Metaverse is the next big thing, and you must have heard this a million times, just like many tech enthusiasts. The diverse elements of the metaverse have the potential to grab the attention of every person on the planet. Many big companies have already placed their stakes in the metaverse. 

10 Free Web Development Courses for Beginners in 2024 - Best of Lot

Hello guys, if you want to learn Web Development in 2024 and looking for best free resources like free online courses, tutorials, and books then you have come to the right place. Earlier, I have shared best online courses to learn HTML, CSS, JavaScript, React, Angular, and Node.js and in this article, I am going to share best free online courses to learn Web Development. The article includes free web-dev courses from sites like Udemy and Coursera which anyone can join free to learn essential Web development skills in 2024. But, Before we get to the 7 best free courses that will teach you everything you need to know about web development, let me tell you what it really is.

10 Example of Hashtable in Java – Java Hashtable Tutorial

These Java Hashtable Examples contain some of the frequently used operations on Hashtable in Java. when I discussed throw of How HashMap or Hashtable works in Java I touched based on the inner working of Hashtable, while in this Java Hashtable tutorial we will see some examples of hashtable in Java like checking a key exits in HashMap or not or get all keys and values from HashMap, Iterating on Hashtable keys and values using Enumeration, checking if Hashtable contains a particular key or value, how to copy mappings from a Hashtable to HashMap in Java, etc.

Friday, July 29, 2022

How to use ArrayList in Java? 10 Examples of ArrayList

ArrayList in Java is the most frequently used collection class after HashMap in Java. Java ArrayList represents an automatic re-sizeable array and used in place of the array. Since we can not modify the size of an array after creating it, we prefer to use ArrayList in Java which re-sizes itself automatically once it gets full. ArrayList in Java implements the List interface and allows null. Java ArrayList also maintains the insertion order of elements and allows duplicates opposite to any Set implementation which doesn't allow duplicates. ArrayList supports both the Iterator and ListIterator for iteration but it’s recommended to use ListIterator as it allows the programmer to traverse the list in either direction, modify the list during iteration, and obtain the Iterator's current position in the list.

Top 10 Free Spring Boot and Spring Framework Courses in 2024 - Best of Lot

Hello guys, if you want to learn Spring Framework and Spring Boot in 2024 and looking for free resources like free online courses, tutorials, and books then you have come to the right place. Earlier, I have shared best online courses to learn Spring Framework, Spring MVCSpring Boot, Spring Security, Spring Data JPA, and Reactive Spring/WebFlux and in this article, I Am going to share best free online courses to learn Spring Framework and Spring boot in depth. But, Before we get to the 10 best free Spring courses that are perfect for beginners, let me tell you more about what the Spring Framework really is.

Wednesday, July 27, 2022

How to find current directory in Java with Example

Hello guys, if you want to find current directory in Java and looking for a simple example then don't worry. Its easy to get current directory in Java by using built-in system property provided by Java environment. Current directory represent here the directory from where "java" command has launched. you can use "user.dir" system property to find current working directory in Java. This article is in continuation of my earlier post on Java e.g. How to load properties file in Java on XML format or How to parse XML files in Java using DOM parser and Why Java doesn’t support multiple inheritance . If you haven’t read them already, You may find them useful and worth reading. By the way here is a quick example of finding current directory in Java:

How to read from and write to a text file in Java - Example Tutorial

Java has excellent support for reading from file and writing to file in Java. In the last post, we have seen how to create files and directories in Java and now we will see how to read content from files in java and how we will write text into file in Java. File provides a persistent solution to Java developers; in almost every Java application you need to store some of the data in persistent may be its user configuration, system configuration or related to state of the application but without persistence, no enterprise Java application can buildup. 

How to append text into File in Java – FileWriter Example

As a Java developer we often need to append text into File in Java instead of creating a new File, for example log files where every message is written into same file or appended at the end of the file. Thankfully Java File API is very rich and it provides several ways to append text into File in Java. Previously we have seen how to create files and directories in Java and how to read and write to a text file in Java and in this Java IO tutorial we will see how to append text into files in Java. We are going to use the standard FileWriter and  BufferedWriter approach to append text to File. One of the key points to remember while using FileWriter in Java is to initialize FileWriter to append text i.e. writing bytes at the end of the File rather than writing at the beginning of the File.

How to Copy a File in Java Program - Example Tutorial

How to copy files in Java from one directory to another is a common requirement, given that there is no direct method in File API for copying files from one location to another. A painful way of copying files is reading from FileInputStream and writing the same data to FileOutputStream to another directory. Though this process works it's pretty raw to work with and the best approach is for anyone to create a library for common File operations like cut, copy, paste, etc. 

How to read File into String in Java 7, 8 with Example

Many times you want to read contents of a file into String, but, unfortunately, it was not a trivial job in Java, at least not until JDK 1.7. In Java 8, you can read a file into String in just one line of code. Prior to the release of new File IO API, you have to write a lot of boilerplate code e.g. open an input stream, convert that input stream into a Reader, and then wrap that into a BufferedReader and so on. Of course, JDK 1.5's Scanner class did provide some breathing space but it was still not as simple as it should be, like in Python or Ruby. By using Java 7 new File API and Java 8's new features like lambda expression and Stream API, Java is now close to Python or other utility languages, when it comes to reading the file into String.

Tuesday, July 26, 2022

Top 5 Free and Paid OCAJP, OCPJP Mock Exams and Practice questions - (Java Certification)

In order to do well on Java certifications, you need good books and a reasonable number of practice questions before you go for exams. Practice questions and mock exams will help you to assess your topic-wise preparation level and help you to identify your strong and weak areas. Based on the result of the mock exams, you can concentrate on areas where you lack expertise like multi-threading is one of the tricky areas. It will also expose you to exam patterns and different types of questions you can expect in examination like multiple choice questions, rearranging code, fill in the blanks etc. Though I highly recommend commercial exam simulators like Whizlabs and Enthuware, I also suggest you take advantage of many mock questions which are freely available.

Sunday, July 24, 2022

How to read a File in One Line in Java? Files.readAllLines() Example Tutorial

Reading a file in Java is not simple, it requires lots of boilerplate code, as we have seen in our earlier example of reading text files. Various things had to be wrapped e.g. a FileInputStream inside a BufferedReader, loops with weird terminating conditions had to be specified, and so forth. From JDK 7 onward,  you can do a lot better. It provides lots of useful classes like Files and Paths to deal with file and their actual path. In this article, we will see how we can read a file in just one line. Of course, your production code won't be like that, especially if you are reading a few gigabytes into memory and want to pay attention to the character set, if you don't specify, by platform's default character encoding will be used.

Java 8 - Stream FlatMap Example - List of Lists to List

The flatmap is an interesting concept of functional programming which allows you to flatten the list or stream apart from transforming it, just like the map does. This means you can use the flatmap to flatten the stream. If you have used the map() function from the Stream class before then you can use it to convert an object of type T to another object of Type S. For example, if you have a list of Authors then you can convert it to a List of books by transforming authors to books. FlatMap extends this idea, it not only transform one object to other it also flattens the list and that's it's very useful where you want to know about a combined data set. 

How to convert java.util.Date to java.sql.Date - JDBC Example

You often need to convert java.util.Date to java.sql.Date if you are storing dates in a database e.g. SQL SERVER or MySQL. Since JDBC has their own data types for date and time e.g. java.sql.Date, java.sql.Time and java.sql.TimeStamp to match with database date, time and date-time types, you cannot pass a java.util.Date directly. All methods which are supposed to store dates e.g. setDate(paramName, paramValue) expects java.sql.Date, so it becomes essential to know how to convert java.util.Date to java.sql.Date in JDBC. You would be surprised to know that java.sql.Date is a subclass of java.util.Date and all it does is suppress or remove time-related fields from java.util.Date.

Saturday, July 23, 2022

How to convert String to Date in Java - SimpleDateFormat Example

Hello Java developers, you may know that SimpleDateFormat in Java can be used to convert String to Date in Java. java.text.SimpleDateFormat is an implementation of DateFormat which defines a date pattern and can convert a particular String that follows that pattern into Date in Java. This is the second part of the article on java.util.Date and String in Java. In the first part, we have seen How to convert Date to String in Java. SimpleDateFormat accepts a String in any date format e.g. yyyyMMdd is a date pattern and  20220924 is a String in that format. Now you want to create a java.util.Date object from this String.

How to Convert Date to String in Java with Example

As a Java developer we often need to convert java.util.Date or LocalDate to String in Java for  displaying purpose or sending Date as String in JSON or XML messages and that's where having a agree upon Date Format is very important. It easily allows you to convert your Date as String and pass between two System. I need it that while working on displaying date in my application and then I thought about this article to list down various way of converting this in various ways after some reading I found that SimpleDateFormat makes this quite easy. 

How to convert Date to LocalDate and LocalDateTime in Java 8 - Example Tutorial

The easiest way to convert a java.util.Date to java.time.LocalDate is via Instant, which is the equivalent class of java.util.Date in JDK 8. You can first convert util Date to Instant and then create a LocalDateTime object from that instant at your default timezone. Once you have an instant of LocalDateTime, you can easily convert that to LocalDate or LocalTime in Java. If you are not living under the rock in the last two years that its 2016 and Java 8 has been around for more than 2 years, 18th March 2014 Java SE 8 GA happened.

17 Examples of Calendar and Date in Java - Tutorial

The java.util.Calendar class was added in Java on JDK 1.4 in an attempt to fix some flaws of the java.util.Date class. It did make some tasks simpler, e.g. create an arbitrary date comes easier using the new GregorianCalendar(2016, Calendar.JUNE, 11) constructor, as opposed to the Date class where the year starts from 1900 and the Month was starting from zero. It didn't solve all the problems like mutability and thread-safety of Date class still remains, but it does make life easier at that time. Now with Java 8 everything related to Date and Time has become super easy and consistent but unfortunately, it will take another 5 to 10 years before the older version of Java goes away. Don't believe me, there are still applications running on JDK 1.5 which was released 12 years ago. The bottom line is it's still important to know about the Date and Calendar in Java.

10 Examples of Optional in Java 8

Null is bad, it can crash your program. Even its creator called it a billion-dollar mistake hence you should always try to avoid using nulls whenever you can. For example, you should not return a null String when you can return an empty String, similarly never return null collections when you can return an empty collection. I have shared many such tips in my earlier article, 10 tips to avoid NullPointerException and my reader liked that a lot. But, I wrote that article a couple of years ago when Java 8 was not around and there was no Optional, a new way to avoid NullPointerException in Java, but, things have changed now.

Thursday, July 21, 2022

Review - Is Metaverse Professional Certification on 101 Blockchains worth it?

The metaverse is the next big thing, and you must have heard this a million times, just like many tech enthusiasts. The diverse elements of the metaverse have the potential to grab the attention of every person on the planet. Many big companies have already placed their stakes in the metaverse. Therefore, it is quite clear that a Certified Metaverse Professional certification would be helpful in terms of career development. Interestingly, the opportunities for career development in the metaverse have been doubling in recent times. The following discussion helps you find whether the CMP certification by 101 Blockchains is the best choice in metaverse certifications for you.

10 Difference between Java and JavaScript for Programmers

Programmers, developers, and internet users have always been confused between Java and JavaScript.  Many people still think that JavaScript is part of the Java platform, which is not true. In truth, JavaScript has nothing to do with Java, the only common thing between them is the word "Java", much like in Car and Carpet, or Grape and Grapefruit. JavaScript is a client-side scripting language for HTML, developed by Netscape, Inc, while Java is a programming language, developed by Sun Microsystems. James Gosling is the Inventor of Java, popularly known as the father of Java. 

How to get current URL, parameters and Hash tag using jQuery and JavaScript? Example

While dealing with the current URL, many times you want to know what is the current URL path, What are the parameters, and what is the hashtag on the URL. The hashtag is pretty important if you are implementing a tab structure using HTML and JQuery. To avoid confusion, let's take an example of a URL: http://javarevisited.blogspot.com/2013/01/top-5-java-programming-books-best-good.html#ixzz2PGmDFlPd, in this example ixzz2PGmDFlPd, is a hashtag. Now, both JavaScript and JQuery provide a convenient way to retrieve the current URL in the form of window.location object. You can use various properties of the window.location JavaScript object like the window.location.href to get complete URL, window.location.pathname to get the current path, and window.location.hash to get a hashtag from current URL.

Tuesday, July 19, 2022

Top 10 Free NFT (Non Fungible Tokens) Courses for Beginners in 2024 - Best of Lot

Hello guys, if you want to learn about NFTs or Non Fungible Tokens and looking for best free online courses then you have come to the right place. Earlier, I have shared best paid NFT courses and in this article, I am going to share best free NFT courses for beginners, Bu, before we get to the 10 best free NFT courses that will teach you everything you need to know about this exciting new technology, let me tell you what it really is. NFTs, also known as Non-Fungible Tokens, are basically unique cryptographic tokens. These tokens exist in a blockchain, which means that they cannot be replicated. Each NFT has a unique identification and metadata. 

Monday, July 18, 2022

How to format/parse dates with LocalDateTime in Java 8 - Example Tutorial

One of the common tasks in a Java project is formatting or parsing data to String and vice-versa. Parsing date means you have a String that represents a date like "2017-08-3" and you want to convert it into an object which represents the date in Java, like java.util.Date in pre-Java 8 world and LocalDate or LocalDatetime in Java 8 world. Similarly, formatting a date means converting a date instance into a String, for example, you have a Date object or LocalDatetime object and you want a String in dd-MM-yyyy format. Java 8 API provides good support for formatting and parsing dates.

Difference between Period and Duration class in Java 8? [Example]

What is the difference between Period and Duration class in Java is one of the popular Java 8 interview questions and has been asked too many of my readers recently. If you were also wondering the difference between Period vs Duration and when to use Period over Duration and vice-versa then you have come to the right place. Java 8 has two classes to represent differences in time like Duration and Period. The main difference between Period and Duration is that they represent the difference in different units, A Duration is used to calculate time difference using time-based values (seconds, millisecond, or hours) but Period is used to measure the amount of time in date-based values like days, months and year.

Friday, July 15, 2022

What is Double Brace Initialization in Java? Example Initializing HashMap and List with values in Java

Double brace initialization is a Java idiom to initialize a Collection like a list, set, and map at the time of declaration. At times, you need a list of fixed elements e.g. supported products, supported currencies, or some other config, and on-the-spot initialization reduces the line of code and improves readability. Double brace initialization idiom becomes popular because there is no standard way to create and initialize Collection at the same time in Java. Unfortunately, unlike other JVM languages like Scala and Groovy, Java doesn't support collection literals yet. 

Wednesday, July 13, 2022

Coursera Review - Is Machine Learning Specialization By Andrew Ng and DeepLearning.AI worth it?

Hello guys, if you are following Andrew Ng on Twitter then you may know that his popular free Machine Learning course from Stanford is now turning into full fledged Machine Learning specialization from both Stanford and DeepLearning.ai, which is a great new for all the people who want to learn Machine Learning in 2022. There are many people like me who got our first introduction to Machine Learning using that course and its no surprise that more than 5 million people have already joined this course. With this new specialization, Andrew Ng has provided one of the most authentic, comprehensive and Engaging Machine Learning resources for beginners. In the past, I have shared best Coursera courses to learn Machine LearningData Science, and Blockchain and in this article, I will share my 2 cents about this Machine Learning specialization course on Coursera.

Top 5 Courses to Learn Kali Linux in 2024 - Best of Lot

Kali Linux is an open-source Debian system based on Linux developed by the offensive security company for ethical hackers. It contains more than 400 tools categorized to make it easy for security researchers to analyze your network, test the system security, discover different vulnerabilities inside a web application, hide malware in apps, and target Android phones. If you want to learn Kali Linux and looking for the best online courses to learn Kali Linux on your own then you have come to the right place. Earlier, I have shared the best Ethical Hacking courses and Cyber Security Courses, and in his article, I am going to share the best Kali Linux courses for beginners. 

Monday, July 11, 2022

Top 6 Free Courses to Learn Scala and Functional Programming in 2024 - Best of Lot

Scala is a powerful object-oriented and functional programming language long touted as the successor to Java or to replace Java. Well, that didn't happen in the last few years, but Scala has undoubtedly made a lot of progress and established itself as a scalable programming language for big things. If you are a social media user and know Twitter, then let me tell you that they are using Scala, which proves that Scala has all the tools you need to build a high-performance, scalable application like Twitter. Twitter is not the only company that is using Scala. If you look at Scala's website, you will find that IBM, Goldman Sachs, Verizon, and SAP use Scala to solve their problems.

Sunday, July 10, 2022

Top 5 Online Courses to Improve Email and Workplace Writing Skills in 2024 - Best of Lot

One of my readers emailed me a couple of days ago and asked If I could suggest something to improve his email writing skills? He says that he is very good at work and programming but sucks on writing emails, and because of that, he never gets the visibility he deserved, resulting in no promotion or career growth. This sounds to be a prevalent problem, especially among programmers whose native language is not English, and who have never attended any business or email writing course. In fact, it was a problem for me as well, but I slowly picked it up though I am still far behind with many people I know who have excellent email communication skills.

Top 5 Courses to learn iOS and Swift for Beginners in 2024 - Best of Lot

Hello guys, it's that time of the Year when we all start making our goals for better health, improving ourselves, and learning new things. Last Year, I focused mainly on the Web Development side and spent time teaching React, Angular, and Node JS, but this year, one of my goals is to explore the mobile world, particularly iOS and Android. At least that's a thought for now, and I am not sure how long I can go given the limited time I get to upgrade myself, but I'll try my best. Btw, suppose you also have the same goal and want to become an iOS developer in 2024. In that case, you should start your journey by learning iOS, Apple's Operating system, which runs on iPhone and iPad, and Swift 5, Apple's programming language for creating iOS apps.

Saturday, July 9, 2022

Top 5 Courses to Learn JavaFX Online in 2024 - Best of Lot

Hello guys, if you want to learn Java FX and look for the best Java FX courses, you have come to the right place. Earlier, I have shared the best Java Programming programming courses, and today, I will share with you the best online courses to learn Java FX from scratch. Java FX is the latest and greatest way for creating a GUI application in Java. There was a time when AWT and Swing was very popular for developing GUI based application in Java. Still, slowly Java Swing lost that place to C#, which became the standard language for developing desktop GUI and AWS lost the battle with Swing.

Friday, July 8, 2022

Top 5 Courses to Learn WordPress for Beginners in 2024 - Best of Lot

Hello guys, if you want to learn WordPress to create websites and start your career in web design and website development then you have come to the right place. WordPress is one of the most popular platform for website design and hosting all kind of websites like blog, e-commerce, simple website and more and learning Website is one of the best skill to acquire in 2024.  In the past, I have shared the best courses to learn HTMLCSSJavaScriptBootstrap, and Web development, and today I will share about the best online training courses to learn WordPress. WordPress is one of the easiest ways to create a website. It's also one of the most essential tools for web designers and web developers. If you know WordPress, you can work on different kinds of companies like startups and even multi-national. WordPress also allows you to do a lot of freelancing work.

Thursday, July 7, 2022

Right way to Close InputStream and OutputStream in Java - Example

For some unknown reasons many Java programmers are not very comfortable with IO package. I don't know why, but I have found them much more comfortable with java.lang and java.util than java.io. One possible reason of this could be that, writing IO code require a bit of C++ like programming, which involves doing clean-up, releasing resources once done etc. Since Java made coding a lot easier by taking care of memory management, unknowingly it also introduced bad practice of not releasing resource after use like database connections, socket connection, files, directory, printers, scanners or any other scarce resource.

Wednesday, July 6, 2022

Top 7 advanced Microsoft Excel Courses to Learn Macros and VBA in 2024 - Best of Lot

Hello guys, if you want to become an Excel power user by learning advanced Excel features like Macros and VBAs and looking for advanced Excel courses then you have come to the right place. Earlier, I have shared some of the best Excel courses for beginners and in this article, I am going to share the best advanced Excel courses for experienced developers. These online courses will teach you potent Excel features like Macros, VBA, and all sorts of charts that help in Data Visualization. These are the features that make Excel a powerful tool for Automation and Data Visualization, an essential skill of today's data-heavy world. The programming power added by VBA can also significantly help your Data Analysis by much automatic time consuming and tedious tasks, and that's why it's essential to learn these features to fully unlock Microsoft Excel's potential.

Top 5 Courses for CompTIA Network+ certification (with Practice Tests) in 2024 - Best of Lot

Hello guys, CompTIA Network+ certification is a good certification to aim for if you are planning to have any kind of job position that needs networking such as computer networking analyst, computer support, and so on. The certification is aimed at anyone beginner or advanced level of networking knowledge and it is good also if you are considering a career in the network industry. If you already preparing for CompTIA Network+ certification and looking for the best online training courses and practice tests to get ready for the exam then you have come to the right place. Earlier, I have shared the best CompTIA A+Cloud+Security+, and Server+ courses and practice tests and In this article, I am going to share the best online courses and mock questions to prepare for CompTIA Network+ certification. 

Top 15 Java String interview Question Answers for 3 to 5 Years Experienced

10 Java String interviews Question answers
String interview questions in Java is one of Integral part of any Core Java or J2EE interviews. No one can deny the importance of String and how much it is used in any Java application irrespective of whether it's core Java desktop application, web application, Enterprise application or Mobile application. The string is one of the fundamentals of Java programming language and correct understanding of String class is a must for every Java programmer. What makes String interview questions in Java even more interesting is the special status of String in terms of features and privileges it has like the + operator is kind of overloaded to perform String concatenation despite the fact that Java does not support operator overloading. There is a separate String pool to store String literal etc.

How to compare two String in Java - String Comparison Example

String comparison is a common programming task and Java provides several way to compare two String in Java. String is a special class in Java, String is immutable and It’s used a lot in every single Java program starting from simple test to enterprise Java application. In this Java String compare tutorial we will see different ways to compare two String in Java and find out how they compare String and when to use equals() or compareTo() for comparison etc.

Here are four examples of comparing String in Java
1) String comparison using equals method
2) String comparison using equalsIgnoreCase method
2) String comparison using compareTo method
4) String comparison using compareToIgnoreCase method

Top 5 Courses & Practice Tests to Crack CompTIA Security+ Certification (SY0–601) in 2024 - Best of Lot

Hello guys, the CompTIA Security+ certification is aimed to be for people who are beginner in security but at least have some fundamentals in IT in general and you will learn some fundamentals in  Cyber Security such as SQL injection, malware, zero-day vulnerabilities, and much more. If you are preparing for CompTIA Security + Certification and looking for the best online training course to boost your preparation then you have come to the right place. In the past, I have shared the best Cyber Security courses, best Ethical Hacking coursesCompTIA A+ Courses, Cloud+ Courses, and today, I will share the best online courses to crack the CompTIA Security+ certification. These courses have been prepared by experts and trusted by thousands of candidates preparing for this prestigious exam.

Which is the best course to Learn Spring Security 5 and Spring Data JPA for Java Programmers?

If you are a Java Spring developer and working with Spring Security then you may be familiar with the "Learn Spring Security" course by Eugen Paraschiv of Baeldung. It is one of the most advanced and comprehensive courses on Spring Security and the best part of this course is that Eugen always keeps it up-to-date with the new Spring Security release. Now that version Spring Security 5 is out - he has updated his course to use new features of Spring Security 5. Btw, there is some really cool new functionality coming in Spring Security 5 for the reactive programming model, and many other improvements and new features. But, the most important one is the release of OAuth2.

Saturday, July 2, 2022

How to Remove First and Last Character of String in Java - Example Tutorial

You can use the substring() method of java.lang.String class to remove the first or last character of String in Java. The substring() method is overloaded and provides a couple of versions that allows you to remove a character from any position in Java. Alternatively, you can convert String to StringBuffer or StringBuilder and then use its remove() method to remove the first or last character. Both StringBuffer and StringBuilder provides a convenient deleteCharAt(int index) method which removes a character from the corresponding index. You can use this method to remove both first and last characters from String in Java.

How to get first and last character of String in Java - Example

You can get the first and last character of a String using the charAt() method in Java. This method accepts an integer index and returns the corresponding character from String. Since Java String is backed by an array, their index is also zero-based, which means the first character resides at index zero, and the last character is at index, length-1, where length is the number of characters in the String. You can get the length of the String by calling the length() method. The charAt() method is not defined on java.lang.String class, but on its super interface java.lang.CharSequence, hence it will also work for StringBuffer and StringBuilder.

How to check if String is not null and empty in Java? Example

In Java, since null and empty are two different concepts, it's a little bit tricky for beginners to check if a String is both not null and not empty. A String reference variable points to null if it has not been initialized and an empty String is a String without any character or a string of zero length. Remember, a String with just whitespace may not be considered as empty String by one program but considered as empty String by others, so, depending upon your situation, you can include the logic to check for that as well. A String with just white space is also referred to as a blank String in java. In this tutorial, I will teach you a couple of right ways to test if a String is not null and not empty in Java.

101 Blockchains Review - Is Enterprise Blockchain Professional Certification worth it? [CEBP]

Hello guys, last year, I was looking for a comprehensive Blockchain Certification when I stumble upon Certified Enterprise Blockchain Professional (CEBP) by 101 Blockchins.com, a site dedicate to teach you Blockchain, NFT, Metaverse, and Web3 skills. This was the Blockchain course I was looking from start as the most of the courses I found are either too shallow or too much technical that you will start feeling sleepy from first lecture. This Blockchain course was just right. It not only covers everything you need to know about Blockchain technology but also cover them in engaging and detailed way. When I first mention this course on my list of best Blockchain certifications and courses, a lot of you asked me to publish a detailed review of this course and here we are.