Concatenate String and Integers in Java

Samual Sam
Updated on 30-Jul-2019 22:30:23

9K+ Views

To concatenate a String and some integer values, you need to use the + operator. Let’s say the following is the string. String str = "Demo Text"; Now, we will concatenate integer values. String res = str + 1 + 2 + 3 + 4 + 5; The following is the final example. Example Live Demo public class Demo { public static void main(String[] args) { String str = "Demo Text"; System.out.println("String = "+str); String res = str + 1 + 2 + 3 + 4 + 5; System.out.println(res); } } Output String = Demo Text Demo Text12345

Add 1 Day to the Date in MySQL

George John
Updated on 30-Jul-2019 22:30:23

13K+ Views

We can add 1 day to the date with the help of DATE_ADD() function. Creating a table. mysql> create table Add1DayDemo -> ( -> id int, -> MyDate datetime not null -> ); Query OK, 0 rows affected (1.06 sec) Insert some records. mysql> insert into Add1DayDemo values(1, now()); Query OK, 1 row affected (0.08 sec) mysql> insert into Add1DayDemo values(2, date_add(now(), interval 5 day)); Query OK, 1 row affected (0.16 sec) To display all records. mysql> select *from Add1DayDemo; ... Read More

Stack and Queue in Python Using Queue Module

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

644 Views

In Python, it is very easy to implement stack and queue data structures. Stack is called LIFO because Stack works on the principle of "Last-in, first-out" and Queue is called FIFO because Queue works on the principle of "First-in, first-out", and the inbuilt functions in Python make the code shorter and simple. The Queue module implements multi-producer, multi-consumer queues and It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The Queue class in this module implements all the required locking semantics and it depends on the availability of thread support in Python. This ... Read More

Check If Binary Representation Is Palindrome in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

4K+ Views

A palindrome is a sequence that is same both forwards and backwards. The binary representation of a number is checked for being a palindrome but no leading 0’s are considered. An example of this is given as follows − Number = 5 Binary representation = 101 The binary representation of 5 is a palindrome as it is the same both forwards and backwards. A program that demonstrates this is given as follows. Example Live Demo public class Example { public static void main(String argc[]) { long num ... Read More

Intersection of Two Arrays in Java

Samual Sam
Updated on 30-Jul-2019 22:30:23

2K+ Views

The intersection of the two arrays results in those elements that are contained in both of them. If an element is only in one of the arrays, it is not available in the intersection. An example of this is given as follows − Array 1 = 1 2 5 8 9 Array 2 = 2 4 5 9 Intersection = 2 5 9 A program that demonstrates the intersection of two sorted arrays in Java is given as follows. Example Live Demo public class Example { public static void main(String args[]) ... Read More

What is GRUB in Linux

Ricky Barnes
Updated on 30-Jul-2019 22:30:23

10K+ Views

The GRUB (Grand Unified Bootloader) is a bootloader available from the GNU project. A bootloader is very important as it is impossible to start an operating system without it. It is the first program which starts when the program is switched on. The bootloader transfers the control to the operating system kernel. GRUB Features GRUB is the default bootloader for many of the Linux distributions. This is because it is better than many of the previous versions of the bootloaders. Some of its features are: GRUB supports LBA (Logical Block Addressing Mode) which puts the addressing conversion used ... Read More

Introduction to Graph Algorithms

Samual Sam
Updated on 30-Jul-2019 22:30:23

673 Views

The graph is a non-linear data-structure, which consists finite number of nodes and a set of edges which are used to connect a pair of nodes. The graphs are used to solve some real-time problems to represent network etc. In different social networks, the graphs are used. In this Section We are going to cover − Bi-Connected Graph Checking Breadth First Search (BFS) for a Graph Bridges in a Graph Check if a given graph is tree or not Connectivity in a directed graph Depth First Search (DFS) for a Graph Detect Cycle in a an Undirected Graph Detect ... Read More

Display All Tables in MySQL with InnoDB Storage Engine

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

557 Views

To display all table names with ENGINE as InnoDB, implement the following query mysql> SELECT TABLE_SCHEMA as DATABASENAME ,TABLE_NAME as AllTABLENAME ,ENGINE as ENGINETYPE FROM information_schema.TABLES -> WHERE ENGINE = 'innoDB' -> AND TABLE_SCHEMA NOT IN('mysql', 'information_schema', 'performance_schema'); The following is the output. +--------------+------------------------------------------------------------------+------------+ | DATABASENAME | AllTABLENAME ... Read More

Loading Image Using Glide in Android

Chandu yadav
Updated on 30-Jul-2019 22:30:23

4K+ Views

Before getting into Glide example, we should know what is glide, Glide is an image processing library developed by muyangmin. Using glide library we can show image, decode images, cache images, animated gifs and many more.This example demonstrate about how to integrate glide in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code in build.gradle(Module:app).apply plugin: 'com.android.application' android {    compileSdkVersion 28    defaultConfig {       applicationId "com.example.andy.myapplication"       minSdkVersion 15       ... Read More

Introduction to Analysis of Algorithms

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

3K+ Views

In theoretical analysis of algorithms, it is common to estimate their complexity in the asymptotic sense, i.e., to estimate the complexity function for arbitrarily large input. The term "analysis of algorithms" was coined by Donald Knuth. Algorithm analysis is an important part of computational complexity theory, which provides theoretical estimation for the required resources of an algorithm to solve a specific computational problem. Most algorithms are designed to work with inputs of arbitrary length. Analysis of algorithms is the determination of the amount of time and space resources required to execute it. Usually, the efficiency or running time of an ... Read More

Advertisements