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. 

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.

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.

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.

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. 

Saturday, July 9, 2022

3 ways to Learn Redux Framework in depth in 2024 - Best of Lot

The state is a very important part of React development. In simple words, state is a plain JavaScript object that controls the behavior of a React component. If you want to become a professional React developer, then you must understand how to use the state efficiently. React provides inbuilt support for managing state but when the application grows, managing state becomes difficult. So the global state is created for an entire application and to manage such a global state, third-party state management libraries are used.

Thursday, July 7, 2022

Top 7 Pluralsight Courses for Data Scientists to Learn in 2024 - Best of Lot

Hello guys, if you are learning Data Science in 2024 and looking for best online courses to learn Data Science and Machine Learning or got a Pluralsight membership but are not sure which Pluralsight courses to join to better your Python, Data Science, Data Visualization, and other data-related skills then you have come to the right place. Earlier, I have shared the best Pluralsight courses to learn Java, Python, React.js, and JavaScript and today, I am going to share the best Pluralsight courses for Data Science and Data Scientists. These are my favorite Pluralsight courses on the topic as well and even if you are just starting with Data Science you can join these courses to learn a lot. 

Top 10 LinkedIn Learning Courses for Java and Web Developers in 2024 - Best of Lot

Hello guys, if you want to learn Java and Spring Framework in 2024 and are looking for the best LinkedIn learning online courses, you have come to the right place. Earlier, I shared the best Java and Spring Framework courses from Udemy, Coursera, and Pluralsight. This article will find the best Java, Spring, Spring Boot, and Microservices courses for Java developers.  LinkedIn Learning is an educational website by popular social networking site LinkedIn, where I think every Java developer should have their account. It has a lot of practical courses to learn essential skills and technology, and today, I will share the best LinkedIn Learning courses for Java and Spring Boot developers.

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.

Saturday, July 2, 2022

How to Learn Python Programming in 2024?

Hello guys, if you want to learn Python Programming language in 2024, one of the most popular programming language of this time but are not sure where to start then you have come to the right place. In the past, I have shared many Python resources like best Python Books, Courses, Projects, interview questions, and even best places to learn Python and  In this article, I am going to share with you the 3 best ways to learn Python programming from scratch. These are my tried and tested way to master any programming language or Framework and I have used this to learn Java, Python, JavaScript and many other technology. 

Top 10 Python Courses on Pluralsight for Beginners and Experienced Developers - Best of Lot

Hello guys, if you want to learn Python Programming language in 2022 and looking for the best Python online courses on Pluralsight then you have come to the right place. Earlier, I have shared the best Python books, Python 3 courses, and Python websites to learn Python programming and in this article, I am going to share the best Python courses from Pluralsight. If you don't know Pluralsight is a leading online learning platform where you get a chance to learn from expert trainers. They are known for their high-quality courses and they have more than 7500+ courses. They also have many projects and hands-on exercises and you can get access to them with just one Pluralsight membership. 

Top 5 Platforms to learn NFT (Non Fungible Tokens) in 2024 - Best of Lot

Hello guys, if you want to learn Non Fungible tokens or NFT in 2024 and looking for best resources then you have come to the right place. Earlier, I have shared best paid NFT courses and best free NFT courses and in this article, I am going to share best places to learn NFT in 2024. To be honest, It's hard to find good NFT training courses and certifications on sea of resources on internet this article tells best platforms to learn NFT and become a NFT professionals in 2024. The constantly rising fame of non-fungible tokens has induced waves of transformation across various sectors. More and more people are interested in learning more about NFTs and exploring their potential.

Top 10 Courses to Learn Metaverse online in 2024 - Best of Lot

Hello guys, if you want to learn about Metaverse and looking for best online courses then you have come to the right place. Metaverse, Web3, and NFT are three buzz words and latest tech which is dominating  internet at the moment. Earlier, I have shared best NFT online courses and in this article I am going to share best Metaverse online courses for beginners to learn in 2024.  But, before we get to the 10 best courses that you can use to learn everything you need to know about Metaverse, let me tell you what it really is.

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.