Skip to main content

Posts

Showing posts with the label java

Setting Up Java Development Kit in Windows 10 

How to Download, Install, and Setting Up JDK in Windows 10? What is JDK? The Java Development Kit (JDK) is a software development environment for creating applets and Java applications. JDK is an abbreviation for Java Development Kit. It is available for usage by Java developers on Windows, macOS, Solaris, and Linux. JDK assists them in writing and running Java programs. It is feasible to run multiple JDK versions on the same machine. But it's recommended to install Java on Windows 10 with the latest version. In this article, we are going to see how to set up JDK in Windows 10. Let’s divide the article into three parts.   ∘ 1 . Getting the latest JDK version for Windows 10   ∘ 2 . Installing JDK in Windows 10   ∘ 3. Setting up the environment for Java in Windows 10 Let’s see one by one. 1 . Getting the latest JDK version for Windows 10 1 — Download the latest version of JDK from here . Image by Author 2 — Select the needed setup file as per ...

Collection Framework in Java

Data Structure As a definition, the data structure is a specific method of organizing data in a computer so that it may be used efficiently. In this article, we are going to see about the Collection Framework which enables us to implement some important Data Structures available on Java. Topics covered:   ∘ Data Structure   ∘ Collection Framework   ∘ Class vs Interface   ∘ Lists   ∘ Set   ∘ Map   ∘ Difference between List, Set, and Map interface in Java Collection Framework A Java collection is a grouping of separate objects that are represented as a single entity. Java collections, like data, provide all actions such as searching, sorting, insertion, modification, deletion, and so on. Java Collections is a fairly broad topic, and as a newbie, it might be tough to find your way around. We’ve covered all you need to know to get started with Java Collections. Image from  https://www.geeksforgeeks.org/how-to-learn-java-collections-a-complete-guide/ W...

Object-Oriented Programming in Java — Abstraction

To reduce complexity, abstraction in Object-Oriented Programming refers to showing only the essential features of an object to the user and hiding the inner details. In other words, the user only needs to know “what an object does?” rather than “how it does?” Example Image by Author The above sketch is a good real-world example of abstraction. A user can only use and connect with the application’s limited functionality and is uninformed of the system architecture or how the application was built up. Typically, users are only involved with an application’s functionality. Nothing at all is hidden from an administrator , who has access to many more features of the application. The administrator can monitor user activity, understand how the application was created, and implement new features by implementing them in the system. In the previous example, the abstraction is implemented to the user but not to the administrator . Image by Author Let’s take a look at another example of abstract...

Object-Oriented Programming in Java — Multiple Inheritance

Multiple Inheritance occurs when a class is derived from more than one base class, i.e. when a class has more than one immediate parent class. For example 1. A Hyundai Elantra IS A Car 2. A Hyundai Elantra IS A Sedan as well A class in Java cannot extend from more than one class. As a result, the question of “ how can we implement multiple inheritances ” arises. Interfaces are the answer to the preceding question. Interfaces can be used to implement multiple inheritances in Java. A class may implement multiple interfaces, and an interface may extend from multiple interfaces. Take the same example mentioned above. That can be implemented using the following. 1. A base class named Car 2. An interface named IsSedan 3. An Elantra class derived from Car and implementing IsSedan The above illustration then becomes, Image by Author Implementation in Java The output is The model of Elantra is: 2019 The manufacturer of Elantra is: Hyundai The variant of Elantra is: Sport The bootspac...