Casting in Java refers to converting a variable from one data type to another. Java supports both implicit (automatic) and explicit (manual) casting. Implicit Casting (Automatic) Implicit casting happens when you assign…
Category: Java
Fisher-Yates algorithm in Java
The Fisher-Yates algorithm is a method for generating a random permutation of a finite sequence. Here is how you can integrate the Fisher-Yates shuffle algorithm in the existing Java class: Here is…
Power of 2[Leetcode231]
You can check if a number is a power of 2 using recursion in Java by repeatedly dividing the number by 2 and checking if it eventually becomes 1. If it does,…
Coin Change problem [Leetcode322]
The Coin Change problem can be solved using various algorithms such as Dynamic Programming, Recursion, or even Greedy algorithms for specific scenarios. Below is a Java implementation using Dynamic Programming: The problem…
Free Java Tutorials Video Course – 2023
Learn Java – Free Java Courses for Beginners https://www.freecodecamp.org/news/learn-java-free-java-courses-for-beginners/ W3 Schools Java Tutorials https://www.w3schools.com/java/ Java Full Course Learn Java Online https://www.learnjavaonline.org/ Java Tutorial for Complete Beginners https://www.udemy.com/course/java-tutorial/ 1
Java tutorial – 5 Java OOD
Class in Java In Java, a class is a blueprint for creating objects. A class can contain variables and methods. When an object is created from a class, we say an instance…
Java tutorial – 4 Java data structure
Java Strings Strings in Java are objects of the String class, and they are immutable, which means once a String is created, it cannot be changed. If you perform an operation that…
Java tutorial – 3 Java methods
Methods in Java In Java, a method is a block of code that only runs when it is called, you can put some parameters as input, and it returns the value as…
Java tutorial – 2 data types
Java Data Types Primitive Data Type In Java, there are two types of data types: Primitive data type and Non-primitive data type. Primitive Data Types: These are the built-in data types in…
Java tutorial – 1 introduction
Overview of Java Java is a popular programming language developed by Sun Microsystems (now owned by Oracle), to develop mobile apps, web apps, desktop apps, games, and much more. Java is a…