HTML

Top 5 Courses to Learn Ruby and Rails in 2020 - Best of Lot

Hello guys, welcome to this post, here you will find some of the best free courses to learn Ruby programming language and Ruby on Rails framework online. If you don't know what Ruby is and what is Rails framework, then let me tell you that its one of the simplest programming languages with little to no syntax. If you are new to programming or never coded before, then also developing a Ruby application will be much more comfortable than choosing any other programming language like Python or Java. When it comes to developing web development, the Ruby on Rails also makes your job easy by making several useful assumptions based upon convention, which means you can do more by writing less code.

How to copy Files from one directory to other in Java

I have been programming in Java for a long time and you won't believe but there was no file copy method in the Java API until Java 7. At that time, our options were either write it ourself, using a FileInputStream, a FileOutputStream and a buffer to copy bytes from one to the other - or better yet, use the FileChannel.transferTo() method or just use the Apache Commons' FileUtils which was a life save those days and even today. JDK has evolved now and you have a decent API to copy files from one directory to another. In this article, I'll show you both the pre-Java code for copying files from one directory to other as well post Java 7 code which makes this task a lot easier.

Top 7 Free courses to learn Selenium in 2020 - Best of Lot

Testing is an integral part of software development, and we have long been relied on manual testing by testers and QA professional to ship quality software and find bugs, but that's not sustainable anymore. There is an increased focus on automation testing nowadays, and Selenium is leading the way with its web drivers. If you don't know what selenium is, it's a free automation testing tool for web applications. It can work with different web browsers like Chrome, Firefox, Internet Explorer, Opera, and simulate human-like behavior. By using Selenium, you can programmatically interact with all the different elements on a webpage. You can click on them, input text, extract text, and so much more.

Merge Sort in Java - Algorithm Example and Tutorial

The merge sort algorithm is a divide and conquers algorithm. In the divide and conquer paradigm, a problem is broken into smaller problems where each small problem still retains all the properties of the larger problem -- except its size. To solve the original problem, each piece is solved individually; then the pieces are merged back together. For example, imagine you have to sort an array of 200 elements using the bubble sort algorithm. Since selection sort takes O(n^2) time, it would take about 40,000-time units to sort the array. Now imagine splitting the array into ten equal pieces and sorting each piece individually still using selection sort. Now it would take 400-time units to sort each piece; for a grand total of 10*400 = 4000.

Difference between int and Integer in Java?

Both int and Integer are two important data types in Java which often cause confusion between new Java developers. Both int and Integer used to represent numeric data and related to each other in the sense of primitive and Object. Int is a primitive data type that has 32-bit and stores values from  -2^31 to 2^31-1 while Integer is a class that wraps an int primitive inside it. In this article, you will learn why we need Integer Class in Java, particularly, if we already had the int data type, how to convert from int to Integer in Java, and various points on Integer in Java, ranging from basics to advanced BigInteger and AtomicInteger stuff.

How to find repeated characters in a String with Count in Java? [Solved]

This is another interesting coding problem or programming exercise for beginner programmers. How do you find repeated or duplicate characters in given String and their count? You can solve this coding problem in any programming language of your choice like Java, Python, Ruby or even JavaScript. I'll explain the logic and solution which is easy to implement in the above programming languages and I'll provide code in Java, which is my favorite programming language.  In order to solve this problem, You need to first check if a String contains any duplicate character or not and then if it contains any duplicate letters than find out how many times they appear in given input String.

Top 5 Free R Programming Courses for Data Scientists - Best of Lot

More and more people are learning the R programming language to become a Data Scientist, one of the hottest and high paying technical jobs on the planet. Though I am from Python camp when it comes to choosing between Python and R for Data Science, Machine Learning, and Artificial Intelligence, mainly because of the excellent libraries Python offers, I had tried R for a short time. If you are also on the same boat and want to try or learn R programming for Data Science and machine learning purposes and looking for some excellent free courses to start your journey, then you can take some ideas from this article.

How to sort an Array in descending order in Java - Example

Sorting an array is one of the common tasks in Programming and you have many algorithms to sort an array, like QuickSort, MergeSort which provides O(NLogN) time performance and Bucket Sort, Counting Sort and Radix Sort algorithms which can even sort some array in O(N) time. But, you hardly need to code these algorithms by hand when it comes to writing real code. The Programming language you will use already has tried and tested implementation for those algorithms and that's what you will learn in this article. In Java Programming language, it's easy to sort an array, you just need to call the Arrays.sort() method with a Comparator which can sort the array in the order you want but it highly depends upon which type of object is stored in the array.

Top 25 Examples of ConcurrentHashMap in Java 8 - Tutorial

The java.util.ConcurrentHashMap is one of the most important classes of JDK. It was introduced in JDK 1.5 along with other concurrent collection classes like CopyOnWriteArrayList and BlockingQueue. Ever since then, it has been a workhorse in concurrent Java applications. It won't be an exaggeration If I say there is hardly any concurrent Java application which has not used ConcurrentHashMap yet. The class was another implementation of Java .util.Map and a popular hash table data structure with concurrency inbuilt. This means you can also pass a ConcurrentHashMap to a method that is expecting a java.util.Map object. It was made scalable by dividing the whole map into a different segment, known as concurrency level, and then allowing threads to modify segments concurrently.

How to Remove an Element from an Array in Java? Example Tutorial

Hello guys, In the last article, you have learned how to reverse an array in place in Java, and today I have come back with another array-based coding interview question. It's also one of the frequently asked coding questions, not as popular as the previous one but still has been asked a lot of times on various Programming Job interviews, particularly to beginners. In this problem, you are asked to write a program to remove a given number from the given array. It may seem easy, but the trick is that because an array is a fixed data structure and you cannot change the length of the array once created. So, you need to clarify with the Interviewer, what is the meaning of removing an element from the array here. Does he want to return an array without that element or just set that index to a null or empty string?

How to append text to file in Java? Example Tutorial

Hello guys, In this article, I'll teach you how to append text to a file in Java. Earlier, I have taught you guys how to create a file and write text into it, but, append is totally different than creating a new file and writing data into it. In the case of append, the file already exists and you just add text at the end of the file. One popular example of appending text into a file is a log file that is constantly updated because your application continuously appends log details into it. While you don't need to create a logging framework here, just knowing how to append text into an existing file in Java is useful for Java programmers of all kinds of experience.

What is the cost of Oracle Java Certifications - OCAJP8, OCPJP8, OCEWCD, OCMJEA?

One of the frequently asked questions about Oracle Java certifications, formerly known as Sun Certified Java programmer like OCAJP, OCPJP, OCEWCD, OCMEJA, etc. is about the cost of certification. Many of my readers often ask what the cost of OCAJP  like OCAJP 8 or OCAJP 11 and  OCPJP like OCPJP 8 and OCPJP 11 is? Is there any discount available? What are the fees of Java 8 certifications? How much Java architect exam cost? Etc. I have answered many of them one to one via Facebook and Email in the past, but after so many such requests, I decided to write a blog post about it.

Top 10 Object Oriented Programming Concepts and Fundamentals

Object-oriented programming (OOP) is a programming style that is used to solve the problem by thinking in terms of real-world objects like Car, Bag, Animal, etc. It also helps you to organize code, which makes it easier to understand and solve complex programs. Objects hold information about state and behavior. States are the characteristics of the object, or the words you would use to describe it, and usually, take the form of is or has descriptors. A computer is either on or off, a chair has four legs, and you have a name. Behaviors are the things the object can do, or the actions the purpose can perform and are usually verbs that end in ing, like You are sitting, using a computer, and reading this article.

40+ Java IO and Files Interview Questions with Answers

Good knowledge of Java IO API is important for any Java developer but many of them barely pay attention to Java IO and NIO API, and that's why they often struggle during Java interviews when a question related to Input-Output operation is asked. In the past, I have shared many Java interview questions on topics like Collections, Concurrency, JVM internals, Garbage Collection, OOP, Design Patterns and Data structure based coding problems, which received good feedback and helped many Java developer on their Java Interview preparation. Consequently, many of my readers were also asking about Java IO and File-based interview questions and this was one of the pending items on my TODO list for quite some time.

Top 50 Garbage Collection and Java Performance Interview Questions and Answers

Hello Java Developers, If you have gone through any Java Developer interview, particularly for senior developer role than you know that a good knowledge of JVM internals and Garbage collection is important. Even though Java and JVM take care of memory management for you, bad code can still cause memory leak and performance issues. For example, if you are creating millions of objects in a loop or keeping an un-intended reference of dead objects then you are putting additional strain on the Garbage collector and creating memory leak in your application. You cannot blame Java and JVM for that and the only way to avoid such errors is knowing about how Garbage collection works.

Top 3 Free Struts Books for Java EE developers - Learn Online, PDF download

Jakarta Struts is one of the most popular MVC frameworks to create a Java web application. Struts 1.0 had ruled the world in the early 2000 era before Spring MVC took over. Still, there are lots of projects written in Struts that need active maintenance, and that's why Struts developers are still in demand. It has not become anything like COBOL, but the latest version of Struts 2.0 is a capable web MVC framework with dependency injection and has a sizable community behind it. It has close competition with Spring MVC, but given the demand for Struts developer, it's still a good technology to learn if you are looking for a job in Java web development position.

Difference between CountDownLatch and CyclicBarrier in Java Concurrency

Difference between CountDownLatch and CyclicBarrier in Java
Both CyclicBarrier and CountDownLatch are used to implement a scenario where one Thread waits for one or more Thread to complete their job before starts processing but there is one difference between CountDownLatch and CyclicBarrierin Java which separates them apart and that is, you can not reuse same CountDownLatch instance once count reaches to zero and latch is open, on the other hand, CyclicBarrier can be reused by resetting Barrier, Once barrier is broken.