Distance between two points in java

2 methods to calculate distance between two points in java with code example. 1- Using formula. 2- Using a Point class objects. Distance between two points using formula We know that the distance between two points (x1,y1) and (x2,y2) on a flat surface is as below. That we’ll use in the java program to find … Read more

Shape Interface Implementation: Java Exercise

EXERCISE: Create a Shape interface having methods area () and perimeter (). Create 2 subclasses, Circle and Rectangle that implement the Shape interface. Create a class Sample with main method and demonstrate the area and perimeters of both the shape classes. You need to handle the values of length, breath, and radius in respective classes to … Read more

Extract Numbers from String – Java

Java code to extract digits or numbers from a string with logic and explanation. We’ll use 2 methods: (1) using regex expression with replaceAll method of String object, and (2) using loop and ascii values of characters. Extract Numbers from String using regex Logic: Use the regular expression [^0-9] to find non-integer characters in the … Read more

Test Your Skills in OOPs Concepts with JAVA and Master Quickly

#1 Reason that destroy your growth and work life balance is not having a crystal-clear understanding and writing working code without efficient use of OOP features. Get strong hold on object-oriented programming concepts in no time with the new book OOP Concepts Booster. TEST YOUR OOP CONCEPTS LEVEL Q-1– Encapsulation concept is—–( Don’t say wrapping … Read more

Arraylist Of Objects In Java

Arraylist of objects in Java with simple code example: Learn how to store user defined objects into an ArrayList. Here is the declaration of the ArrayList will be used to store objects of the Book class. ArrayList<Book> list = new ArrayList<Book>(); In the angle bracket, notice the class name Book. It’s similar to the array … Read more

Freshers FAQ And Study Resources for IT Jobs Preparation

Fresher’s FAQs during Job hunt: Many fresh candidates get questions and doubts during IT job hunt. You’ll find the questions and answers for clarifications here. Fresher’s FAQs during IT job hunt Object Oriented Programming Object-Oriented Programming book: OOP Concepts Booster This book will give you deep knowledge about OOPs concepts in shortest time possible. SQL … Read more