HTML

3 Ways to Convert String to Short in Java - Example Tutorial

In last a couple of examples, I have taught you how to convert String to Integer, Long, Double, Float, Boolean, and Byte in Java and today I will show you how to convert String to Short in Java, but before that let's revise what is short data type in Java. The short is an integral data type similar to the int but it only takes 2 bytes to store data as compared to 4 bytes required by an int variable. Since it takes only 2 bytes or 16 bits to store data, the range of short is also shorter than int. It ranges from -32,768 to 32767 (inclusive) or -2^15 to 2^15 -1. You might be wondering why upper bound is 255 and lower bound is -256 but that's because we have included zero in between.

7 Free Selenium Web Driver Courses with Java and C# to Learn Automation Testing

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 driver. If you don't know what is a selenium, here is a quick intro. Selenium is 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 in a webpage. You can click on them, input text, extract text and so much more.

Difference between Abstract class and Interface in Java 8

Ever since JDK 8 has allowed concrete (non-abstract) methods on the interface like default and static methods, many of my readers have asked me how should they answer the classical abstract class vs interface questions. Earlier, an interface cannot have any concrete methods and that was the main difference between abstract class and interface but now that is not the case. In this post, I'll revisit this hugely popular Java interview question in light of Java 8 changes. As I said, before JDK 8, the level of abstraction was the clear-cut difference between abstract class and interface i.e. interface was the purest form of abstraction which only defines what interface is supposed to do without specifying how they should be implemented, in other words, it only declares API methods and leaves implementation to its subclasses.