• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

Java

Java Interfaces

by admin

Writing an interface is similar to writing a class. But a class describes the attributes and behaviors of an object. And an interface contains behaviors that a class implements. An interface is similar to a class in the following ways: An interface is written in a file with a .java extension, with the name of […]

Filed Under: Java

Java Packages

by admin

A Package can be stated that a grouping of related types (classes, interfaces, enumerations, and annotations ) providing access protection and namespace management. Some of the existing packages in Java are: java.io – classes for input , output functions are bundled in this package. java.lang – bundles the fundamental classes. Creating a Package The package […]

Filed Under: Java

Java Encapsulation

by admin

Encapsulation is a more useful fundamental OOP concept. The other three are inheritance, polymorphism, and abstraction. Encapsulation in Java is data variables and methods together as a single unit. In encapsulation, the variables of a class will be hidden from other classes, and can be accessed only through the methods of their current class. Therefore, […]

Filed Under: Java

Java Abstraction

by admin

An abstract method is a method that is declared without an implementation (without braces, and followed by a semicolon): abstract void walk();. The user will have the information on what the object does instead of how it does it. Abstract Class Abstraction is achieved using abstract classes and interfaces. To use an abstract class, you […]

Filed Under: Java

Java Polymorphism

by admin

Polymorphism, which refers to the idea of “having many forms”, occurs when there is a hierarchy of classes related to each other through inheritance. A call to a member method will cause a different implementation to be executed, depending on the type of object invoking the method. Dog and Cat are classes that inherit from […]

Filed Under: Java

Java Inheritance

by admin

The class which inherits the properties of others is known as subclass (derived class, child class) and the class whose properties are inherited is known as superclass (base class, parent class). extends Keyword The extends is a Java keyword, which is used in inheritance process of Java. It is a keyword that indicates the parent […]

Filed Under: Java

Java Overriding

by admin

In this post, we will learn the OOP of Java overriding means to override the functionality of an existing method. A subclass can define a behavior that’s specific to the subclass type, meaning that a subclass can implement a parent class method based on its requirement. This is called Overriding. Example: class Animal { public […]

Filed Under: Java

Java – Inner classes

by admin

Java supports nesting classes; a class can be a member of another class. Creating an inner class is quite simple. Just write a class within a class. Unlike a class, an inner class can be private. Once you declare an inner class private, it cannot be accessed from an : Nested Classes In java have […]

Filed Under: Java

Java File and I/O

by admin

java.io packager provides many data such as primitives, object, localized characters, etc. Stream Sequence of data is called stream. There are two types of Streams: InPutStream: The InputStream is used to read data from a source. OutPutStream: The OutputStream is used for writing data to a destination. Byte Streams It uses byte streams to perform […]

Filed Under: Java

Java Methods

by admin

A method is a set of statements to perform an operation, methods are also known as procedures or functions. Creating Method following example to explain the syntax of a method: Syntax: public static int methodName(int x, int y) { // body } Here, public static − modifier int − return type methodName − name of […]

Filed Under: Java

« Previous Page
Next Page »

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright