Posts

Showing posts from July, 2020

Path Finding Algorithm (A* and Dijkstra's)

Image
This Blog is about a project which I did in JANUARY 2021. I created a path finding algorithm simulator using JavaFX. It helps to get a visual representation of two path finding algorithms which are A* and Dijkstra's Path finding Algorithm. I used JavaFX because it is one of the fastest growing technologies in java and it is replacing java swing .JavaFX is much more powerful then java swing and  it has some amazing features like we can apply CSS in JavaFX. The reason why I choose  to A* and Dijkstra's Path Finding Algorithm from a Pool of Algorithm because they help us to  get a basic knowledge of Path finding in Graph. These two are also really great for comparison  with each other and they are also quite famous. Working so let me tell you how this application works. You can download the project by clicking here and then  configure it  in your favorite java IDE .  Now if you have configured the project which I don't think so, then press the run button in your IDE. when the

Java Sealed Class

Image
"Sealed class" is a very important feature and many Languages support this feature.Java until now was not Supporting this Feature but "Sealed Classes" is introduced as a preview feature in JAVA SE 15.So let's see what this feature exactly is! Consider we have the following classes bigCat ,tiger,leopard,dog, bullDog ,beagle.These classes should extend each other in the following way. We should not allow  bullDog or beagle to extend bigCat class since there are not cats, in the same way we should also not allow tiger and leopard to extend dog class since they are not dogs.Until java 14 there is no direct way to restrict one class from extending other.This means that the classes bullDog and beagle can get all the features of the class bigCat just by extending it and this is not desirable. So we can implement the classes as shown in the figure by using some tricks.We can implement it by making the constructor of bigCat and dog as private.After that we can use nestin