Wednesday, January 31, 2024

Difference between List of ? (any type) and List of Object in Java Generics

No doubt that Generics is one of the most confusing topics in Java and you can easily forget concepts and rules, especially, if you don't code Java everyday. For example, both List<?> and List<Object> looks similar but there is a subtle difference between them, the List<?> is basically a list of any type, you can assign a list of String i.e. List<String> or list of Integer i.e. List<Integer> to it. You see the point, it uses the unbounded wildcard <?>, which means any type. It provides it the much needed Polymorphism require while writing Generic methods. Basically, if your method has a type List<?> which means you can pass any type of List to it but remember the type is unknown, until you assign it i.e. List<?> myList = new List<String>(). 

Wednesday, January 24, 2024

Top 5 Java Performance Tuning Books for Experienced Programmers - Best of Lot, Must read

You might be thinking, why should a Java developer read a book on Performance tuning? When I first faced this question a long time back, I thought I will do it later, but I never got back to that for a long time. I realize my mistake of having a lack of knowledge on memory measurement, JVM tuning, and finding bottleneck only when I faced severe performance and scalability issues on our mission-critical, server-side financial application written in Java. It's true that when you really need it, you learn most, but those times are not the best time to learn fundamentals, in fact, those times are to apply and correct your misunderstanding.

Sunday, January 7, 2024

10 Examples of Java Regular Expression Special or Meta Characters

Hello guys, If you want to learn regular expression better in Java, you must remember meaning of all the special characters. They are the one, which makes a regular expression complex, but if you know and understand them then you can easily understand at least 50% of regular expression you encountered in Java applications. They are also known as reserved characters. In a regular expression, a character denotes itself unless it is one of the special character. For example, regular expression "a" will match letter "a" and return true, if input is "a" and false otherwise, but "a*" will not match input "a*", instead it will match any input which contains just e.g. "a", "aaa", or "aaaa". It will also match with empty String because * means zero or more times, so a* means "a" appearing zero or more times, as shown below:

Monday, January 1, 2024

Top 10 Golang Project Ideas for Beginners and Experienced Developers

Hello guys, if you want to learn Golang in 2024 then there is no better way then buidling projects. In my 20 years of programming career I have learned many programming langauge by following this method but its important to choose the right kind of projects to build. Because, if you choose the too tough and complex project then you will fail and lose interest while if you choose trivial projects then you will not enjoy and your learning will not grow, hence I am going to share right kind of Golang projects you can build in 2024 to learn Go programming language but, before we get to some of the best Golang project ideas for beginners, let me tell you what Golang really is. Golang or simply Go is basically an open-source programming language that is focused on simplicity, efficiency, and reliability. It was originally designed by Google way back in 2007. 

How to create a React application using Redux hooks? Example Tutorial

Hello guys, Redux is one of the most popular state management library. It is often used with React apps that are huge in size and state are shared among multiple components. Redux is a complex library to understand and even more complex to implement. It was even more complex and complicated before the introduction of react-redux hooks. Earlier, the connect method provided by Redux was used to connect React with the Redux store. Using connect method with other methods such as mapstatetoprops was complicated. But with the introduction of react-redux hooks, it is easy to use redux with redux. In this article, we will discuss what are react-redux hooks and how to use them with React.