Instance method in Dart with examples

In simple words, instance methods are methods defined in a class those are available with class objects. Instance methods can access to instance variables and this. For example, let's consider the below program :.

Read

JavaScript program to find years with first January Sunday

In this JavaScript tutorial, we will learn how to find out if the first January is Sunday or not between two years. This is a beginner level JavaScript problem. You will learn how to check if a day is Sunday or not using Date class in JavaScript and how to use a for loop.

Read

Find out the largest Date in a JavaScript array

Our problem is to find out the largest Date in a JavaScript array of dates. We will create one array of Date objects and then find out the largest among them.

Read

JavaScript program to find out the largest of three numbers

We can use different ways to find the largest among the three numbers in JavaScript. We can either use extra variables to find the largest or we can directly find without using any extra variables. In this blog post, I will show you different ways to find out the largest of three numbers in JavaScript. Try to go through the programs and drop one comment below if you have any queries.

Read

JavaScript program to find the most frequent element in an Array

Find the most frequent element in an Array in JavaScript in three different ways. We will use a loop, reduce with filter method, and sort method to find the element with the highest occurrence.

Read

Dart instance variable examples

Instance variables are variables declared inside a class. Every object of that class gets a new copy of instance variables. In this post, we will learn how instance variables work and different ways to initialize them.

Read

How Dart class constructors initialized in subclass/superclass

Dart constructors are called when we create an instance of a class. Each class has one default constructor. It is a no-argument constructor and it is invoked if we don't call any other constructors while creating an object.

Read

C print each word in a separate line from an input string

C program to print each word of a string in a separate line. We will learn two different ways to solve this problem with examples.

Read

C program to print the length of each words in a string

In this tutorial, we will learn how to print the length of each words in a string in C. Our program will take one string as input from the user and print out each word with its length. This program will give you an idea on how to read user input string, how to iterate through the characters of that string and how to print one substring of that string.

Read

Kotlin program to remove special characters from a string

In this tutorial, we will learn how to remove all special characters from a string in Kotlin. Our program will remove all non-alphanumeric characters excluding space. For example, if the string is abc 123 *&^, it will print abc 123.

Read