Top 15 SQL Server Management Studio (SSMS) Keyboard Shortcuts and Tips
10 Tools Every Software Developer/Programmer Should Learn in 2023 [UPDATED]
Top 10 Gift Ideas for Programmers, Software Engineers, and Tech Geeks in 2023
How to create Soft and Hard Links in Java? Files + Path + Java NIO Example
Top 22 Libraries and APIs Java Developer should Learn in 2023 [UPDATED]
How to update value for a given key in HashMap - Java 8 getOrDefault() example
10 Microsoft Azure Cloud Certifications You can Aim in 2023 - Best of Lot
Difference between final and effectively final of Java 8? Example Tutorial
Accessing local variable inside Anonymous class in Java
package beginner;
/**
* Java Program to demonstrate how to access local variable
* inside Anonymous class and lambda expression in Java.
*
* @author WINDOWS 10
*
*/
public class HelloWorldApp {
public static void main(String... args){
// count must be final if you want to access it inside
// anonymous class
final int count = 10;
Thread t = new Thread(){
public void run(){
// Cannot refer to a non-final variable count
// inside an inner class defined in a different method
System.out.println(count);
}
};
t.start();
}
}
/**
* Java Program to demonstrate how to access local variable inside Anonymous
* class and lambda expression in Java.
*
* @author WINDOWS 10
*
*/
public class Java8Demo {
public static void main(String... args) {
// in Java 8, final is not mandatory
// unless you are not assigning value
// to the local variable again
int count = 10;
Thread t = new Thread() {
@Override
public void run() {
System.out.println(count); // Ok in Java 8
// local variables referenced from an inner class
// must be final or effectively final
// System.out.println(count++); // not ok
}
};
t.start();
}
}
Accessing local variable inside lambda expression
public class Java8Demo {
public static void main(String... args) {
// you can access final or effectively fina variable
// inside lambda expression.
int count = 10;
Runnable r = () -> {
System.out.println(count); // Ok in Java 8
};
Thread t = new Thread(r);
t.start();
}
}
Top 6 Career Options for Experienced Java Developers in 2023 [UPDATED]
How to convert Milliseconds to Minutes and Seconds in Java? TimeUnit Example Tutorial
10 Tools Used by Java Programmers in Day to day life [UPDATED for 2023]
10 Things Java Programmers Should Learn in 2023 [UPDATED]
How to validate JSON in Java Jackson - Example Tutorial
Difference between -Xms and -Xmx JVM Parameters forJava Heap Memory
Top 40 HashMap Questions and Answers for Java Developer Interviews
Counting Sort Algorithm in Java? Example Tutorial
Top 10 Java idioms I wish I'd learned earlier
10 Example of netstat networking command in UNIX and Linux
Top 5 Spring MVC Annotations for RESTful Web Services in Java
How to use NamedQuery in Spring Framework JDBC? Example Tutorial
Difference between 32-bit and 64-bit JVM in Java?
5 Ways to Convert int to String in Java - Example Tutorial
Top 5 Christmas and New Year Gifts for Programmers and Developers in 2023 [UPDATED]
6 Ways to convert ArrayList to String in Java - Example Tutorial
How to use Stream.distinct() to remove duplicates from List in Java? Tutorial
Top 10 Free JSON Tools for Java and Web Developers
Java Consumer Functional Interface Example
Hello guys, if you are wondering what is a Consumer functional interface in Java and when and how to use it then you have come come to the right place. In the last few article, I have explained what is Functional interface and showed example of Predicate Interface and in this article, I will show you how to use Consumer functional Interface in Java. A Java Consumer is a predefined function interface that has been introduced by java 8. This type of interface accepts only one argument in order to generate the result.
Top 20 JSON Interview Questions with Answers for Beginners and Experienced Developers
Hello guys, if you are doing for a web developer interview or a Java web developer interview where you need to write server side application or backend code which uses HTTP to send and receive data then you should prepare about JSON. It's one of the most popular way to exchange data between two systems or between frontend and backend, client and server and most of the top programming language has API to create and parse JSON like Java has Jackson and JavaScript can by default support JSON because its nothing but JavaScript Object Notation. JSON is also the default data format for REST API and even GraphQL uses JSON to send request and receive response.
10 Example of SCP (Secure Copy) Command in Linux
How to send POST Request with JSON Payload using Curl Command in Linux to Test RESTful Web Services?
Why Programmers Should Learn Mathematics Again?
10 Data Structures Every Programmer Should Learn (with Practice Exercises)
50 Linux Command and Operating System Interview Questions Answers for 3 - 5 Years Experienced IT Professionals
[Solved] How to Find maximum Product of a sub-array in Java? Example
Hello guys, if you are asked to find maximum product of a sub-array in Java and you are wondering how to solve this difficult looking coding problem then you have come to the right place. Earlier, I have shared 30 array coding problems, 30 linked list problems, and 10 dynamic programming problems and in this article, we shall be finding the maximum product of a sub-array in java. This problem has a lot to do with arrays. But first, we'll solve the problem then we talk about Array and how it operates. The problem we are to solve here is to find the maximum product of a subarray in Java. We won't just jump to the writing of codes like code monkeys but, it is essential to understand the problem we are solving first, so we can give the best approach in solutions to it. when we say finding the maximum product of a sub-array it means getting the total of a product in an array!
How to implement Strategy Design Pattern in Java? (with Real World Example, Pros and Cons)
What is SRP or Single Responsibility Principle Example in Java? SOLID Design Pattern Example
How to Rotate Array to Left or Right in Java? Example - LeetCode Solution
Amazon Interview Question - How to Count Negative Numbers in a Sorted Matrix? [Solved]
Is ByteByteGo Course by Alex Xu worth it for System Design Interview in 2023?
How to check if a given Tree is a Binary Search Tree in Java? Example Tutorial
How to merge two sorted arrays in Java? Example Tutorial
Radix sort in Java with Example
23 Object Oriented Design Patterns (GOF) Experienced Java Programmers Should Learn
50 Java Spring Framework Certification Practice Questions Answers for VMWARE EDU-1202 Exam [FREE]
Is Java Pass by Value or Pass by Reference? Example
How to iterate over JSONObject in Java to print all key values? Example Tutorial
How to merge two HashMap in Java 8 - Map.merge() example
12 Database SQL Index Interview Questions and Answers for 2 to 5 Years Experienced
50+ Java Collections and Generics Interview Questions with Answers
Switch case vs if-else-if vs Polymorphism in Java - Example Tutorial
8 ways to Sort List in Java 8 using Lambda Expression + Method Reference - Example Tutorial
Top 5 Common Spring Bean Exception, Error and Solution [BeanDefinitionStoreException, NoSuchBeanDefinitionException, BeanCreationException]
Hello guys, error handling and troubleshooting is an important skill for Java developers. During development you can get variety of exception and sometime they are quite difficult to solve especially if you have no clue what they are and what causing them. Things can be even more difficult if exception is coming from the framework you are using like Spring Framework or Hibernate, that's why its important to know common error and exception for standard framework like Spring. In this article I will explain what BeanDefinitionStoreException, BeanCreationException, NoSuchBeanDefinitionException and BeanDefinitionOverrideException are, what can cause them and how to fix those problems.
Top 20 IT Support Interview Questions with Answers for 2 to 3 Years Experienced in 2023
Java 8 Predicate Functional Interface Example [Tutorial]
Top 20 Bootstrap Interview Questions Answers for 1 to 3 Years Experienced in 2023
Top 15 Cyber Security and Information Security Interview Questions and Answers in 2023
Top 20 Flutter Interview Questions and Answers for 1 to 2 Years Experienced
Top 10 Big Data and Hadoop Interview Questions for Java Developers
3 ways to convert String to Boolean in Java? Examples
Top 20 Rust Interview Questions and Answers for 1 to 2 Years Experienced in 2023
How to implement Selection Sort in Java? Example Tutorial
10 Example of SSH command in Linux and UNIX
Top 20 Kotlin Interview Questions and Answers for Java developers in 2023
Top 20 Blockchain Developer Interview Questions with Answers in 2023
23 Essential skills Java Developers Should Learn in 2023 [UPDATED]
System Design Interview Prep Guide 2023 - Topics, Questions, and Resources
Top 10 System Design Interview Courses for 2023 - Best of Lot
Top 10 Black Friday + Cyber Monday Deals for Programmers - Best of Lot [2023 UPDATED]
5 Best Thinkific, Teachable, Podia, and Learn Worlds Deals & Discounts Coupons [UPDATED]
21 Jenkins and CI/CD Interview Questions for Java Developers and DevOps (with Answers)
Hello guys, if you are preparing for Java developer interview or a DevOps Engineering interview then you must prepare for Jenkins related interview questions. Jenkins is one of the most essential tool for creating build, test, and deploy pipelines in Java world and almost every company and project you work will need a Jenkins pipeline for automation. If you are joining as junior developer then most likely you will already find the pipelines setup for you and you only need to customize it or modify based upon new requirements but if you are joining as an experienced developers or DevOps Engineer and its a green field project then you will most likely need to do all the hard work and setup those Jenkins pipelines from scratch, and its not possible without a good, solid knowledge of how Jenkins works and different plugins.
Top 5 Courses to Learn SQL and Database in 2023 - Best of Lot
Top 5 Free Multithreading Courses for Beginners and Experienced Java Programmers in 2023 - Best of Lot
Hello guys, if you want to learn multithreading and concurrency in Java and looking for best free resources like online courses and tutorials then you have come to the right place. Earlier, I have shared best free Java Courses and best free Spring Framework courses and today, I will share best free online courses to learn Multithreading and Concurrency in Java. Multithreading is one of the important skill for Java programmers as companies are always in hunt of Java programmer who are good at multithreading and concurrency but at the same time its very hard topic to master. Acquiring solid multithreading and concurrency skill require a lot of hard worked and years of experience but you can speed up by joining best Java multithreading courses and learning from expert.