PHP 7 Features Explained with Code Examples.
PHP 7 is the newest version of PHP released last year. PHP community has introduced a lot of new features in their latest version. In this tutorial, we are going to learn about new features added in PHP 7.
Write a java program to find second largest number in an array. Given an unsorted array, write a java code to find second highest number in an array.
Write a Java program to find GCD of two numbers using Recursion. Given two input integers, we have to write a code to find GCD of two numbers using recursion. For this program, I assume you are familiar with the concept of recursion. If you don’t know about recursion then check my previous post on recursion vs iteration.
What is an interface in PHP? An interface is an important concept in an object oriented programming.
In this tutorial, we’ll discuss following points.
1. What is an interface?
2. How to create an interface in PHP.
3. What’s the importance of using an interface in our PHP application?
Interface in PHP
What is an Interface in PHP?
An Interface defines a contract for what a class can do, without saying anything about how the class can do it. Through interfaces, we define what a class can do, the classes that implement interface define how it can do it.
To understand the concept of an interface let’s take an example of a caching system. There are different types of caching available such as File system, Memcache, Redis etc. First, we need to define what a cache can do (I mean different operations), how we do it? we can do it through an interface. A class (Such as Memcache, Redis etc) which implements cache interface will define how they will do it.
NOTE – An interface will not add any additional functionality in your code but it outlines a standard format to which your classes need to use.
Write a java program to print numbers from 1 to 100 without using loop. This is a very interesting and tricky problem for beginners. You have to think how to solve this problem without using loop.
This problem can be easily solved using loop, (for and while loop). So, how do you solve this problem without using loop? The answer is using recursion.
So, In this tutorial, we are going to solve this problem using recursion.
In this tutorial, We are going to learn bubble sort algorithm and it’s implementation in java. We are going to discuss following points in this tutorial.
i) Bubble Sort Algorithm.
ii) Bubble sort program in java (How we can sort an unsorted array using bubble sort algorithm).
iii) Bubble sort video tutorial.
Write a java program to find first non-repeated character in a string. Given an input string, Write a java code to find first non-repeated character in a string.
For example –
i) Input string – java
Output – j (j is the first non-repeating character in a string)
ii) Input string – web rewrite
Output – b (b is the first non-repeating character in a string)
Write a PHP code to find second largest number in array. Given an unsorted array, we have to write a PHP program to find the second largest number in an array.
Apart from solving this problem. We have to focus on time complexity. As the time complexity of an algorithm is very important in terms of an interview.
Abstract class vs interface in PHP. What’s the Difference between an abstract class and interface in PHP? It is one the most important oops concept asked in an interview.
In this tutorial, You are going to learn some important differences between an abstract class and interface.
How to create multiple database connections in Lumen.
Last week I was working on a project in which I need multiple Database connections. I need one separate database connection for reporting (Only for a read operation) and another for the rest of the work (Read & write both).