Latest blog tagged on "Class"

Final class and method in PHP

In our previous section, of inheritance we have seen how derived class (or child class) inherits the function or methods of base class (or parent class). There can be a situation where you want to prevent a class from being inherited.

 PHP PHP  Class 
By Jayden Bell posted   5 months ago

Class Concepts in Java: Declaring Methods

Our Point class declared here contains only fields. Now, we will add a method to the Point class which will help us understand the method declaration and calling syntax.

 Java Java  Class 
By Ailsa Singh posted   6 months ago

Inheritance in Java: Why Inheritance?

One of the major benefits of object-oriented programming is code reuse. Programmers develop lot of code over time.

By Ailsa Singh posted   6 months ago

Exception Handling in Java: Error Types

When a running Java application fails, it creates an exception object encapsulating the error condition and throws it back to the running code.

By Aliya Crox posted   6 months ago

Nested Classes in Java: Anonymous Classes

A local class without a name is called an anonymous class. If we need only a single instance of a local class, we will create an anonymous class. Typically, a local class has a name and thus a declaration.

By Royce Roy posted   6 months ago

Nested Classes in Java: Local Classes

A non-static class defined within a class is called a member class of the enclosing class. A member class is commonly used as a helper class to the enclosing class.

By Royce Roy posted   6 months ago

Nested Classes in Java: Demonstrating Use of Inner Classes

Suppose we are required to create an application that generates a random list of odd numbers.

 Java Java  Nested  Class 
By Jayden Bell posted   6 months ago

Creating a Copy Constructor

One more benefit of constructor overloading is the ability to create a copy constructor, which allows us to create an object copy from the values of another similar object.

 Java Java  Class 
By zack mathews posted   6 months ago

Java Access Modifiers: The protected and default Modifiers

Going back to our asset management example, we have defined several classes that lie in a single hierarchy.

 Java Java  Class 
By Simond Gear posted   6 months ago

Java Access Modifiers: The public and the private Modifiers

Previously we understand the visibility of members at certain level using access modifiers. Now here we see public modifier in detail.

 Java Java  Class 
By Simond Gear posted   6 months ago

Visibility Modes and Access Modifiers in Java

We know java uses four access modifiers public, protected, default and private to maintain visibility at various levels.

 Java Java  Class 
By Simond Gear posted   6 months ago

Understanding Member Visibility Rules

In the examples so far, we have seen the use of the public and private keywords. These are access modifiers that control the visibility of fields, methods, and classes in the scope of the entire application.

 C# Java  Class 
By Simond Gear posted   6 months ago

The final keyword: final variable of class type

Earlier we created and used variables of the class type that hold references to the objects of those class types. Now, we’ll cover an important situation in which such a variable of the class type is declared final.

 Java Java  Class 
By Simond Gear posted   6 months ago

The final keyword: final methods

Just the way we create final classes, we create final methods that cannot be overridden in the subclasses. To explain the purpose behind this, let’s look at an example.

 Java Java  Class 
By Simond Gear posted   6 months ago

Package Statements in java

The package statement allows us to group logically related classes into a single unit. In our earlier programs, we have used import statements such as the following:

By Allen Scott posted   6 months ago

Inheritance in Java: What is Inheritance?

All of us have observed inheritance in nature. For example, a baby inherits the characteristics of her parents; a child plant inherits the characteristics of its parent plant, and so on.

 Java Java  Class 
By Mark Devid posted   6 months ago

Inheritance in Java: Object Creation Process

To better understand the object-creation process, let’s begin with a simple case of two-level inheritance, where we have just a base class and its derived class.

By Royce Roy posted   6 months ago

Method Overloading

In our example of the previous post, the classes Asset, BankAccount, and SavingsAccount defined two constructors.

By Jayden Bell posted   6 months ago

Inheritance in Java: Instantiating a Subclass

In the previous post, we learned how to create a single-level class hierarchy of an arbitrary depth. We created an asset management system, and the top-level class in this system was Asset. We derived several classes from Asset to represent various r

By Allen Scott posted   6 months ago

Java program to find the largest and smallest number along with its index in an array of 10 element

Java program to find the largest and smallest number along with its index in an array of 10 element

 Java Java  Class 

Passing arguments using Command Line in Java

The java command-line argument is an argument i.e. passed at the time of running the java program.The arguments passed from the console can be received in the java program and it can be used as an input


File and Class Name different of a Java program.

If the file name and class name of a java program is different and you have to execute the program using Command Line, will it run?

 Java Java  File  Class 

Object and class in java

Hi everyone in this blog we will learn about java object and classes.

 Java OOPS  Class 
By Kamlakar Singh posted   one year ago

Don't want to miss updates? Please click the below button!

Follow MindStick