
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
502 Views
In Java, garbage collection (the work of destructor) is done automatically using garbage collection. But what if there are objects that have references to them in the code? It can’t be de-allocated, i.e their memory can’t be cleared. If such a situation occurs again and again, and the created or ... Read More

AmitDiwan
3K+ Views
Max heap is a complete binary tree, wherein the value of a root node at every step is greater than or equal to value at the child node.Below is an implementation of Max Heap using library functions.Example Live Demoimport java.util.*; public class Demo{ public static void main(String args[]){ ... Read More

AmitDiwan
988 Views
Following are some key points to undertstand JVM Stack Area −During the creation of a thread, the Java Virtual Machine creates a separate stack.The JVM performs only two operations upon this stack. The operations are push (i.e insert) and pop (i.e delete).When a thread is currently in execution, the stack ... Read More

AmitDiwan
336 Views
Following is the Java program to implement Reversal algorithm for array rotation −Example Live Demoimport java.io.*; public class Demo{ static void rotate_left(int my_arr[], int no_of_rotation){ int n = my_arr.length; array_reversal(my_arr, 0, no_of_rotation - 1); array_reversal(my_arr, no_of_rotation, n - 1); ... Read More

AmitDiwan
950 Views
Following is the Java Program for Recursive Insertion Sort −Example Live Demoimport java.util.Arrays; public class Demo{ static void recursive_ins_sort(int my_arr[], int arr_len){ if (arr_len = 0 && my_arr[j] > last){ my_arr[j+1] = my_arr[j]; j--; } ... Read More

AmitDiwan
200 Views
Following is the Java program for largest K digit number divisible by X −Example Live Demoimport java.io.*; import java.lang.*; public class Demo{ public static int largest_k(int val_1, int val_2){ int i = 10; int MAX = (int)Math.pow(i, val_2) - 1; return ... Read More

AmitDiwan
301 Views
Let us first see an example and create a table −mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(40), StudentAge int, StudentMarks int ); Query OK, 0 rows affected (0.76 sec)Following is the query to know the database structure −mysql> show ... Read More

AmitDiwan
118 Views
To change only dates, not time, use the MySQL INTERVAL and YEAR. Since, we will be updating the records, therefore, use UPDATE and set a new value with INTERVAL.Let us see an example and create a table −mysql> create table DemoTable ( DueDate datetime ); Query OK, 0 rows ... Read More

AmitDiwan
417 Views
Let us first create a table −mysql> create table DemoTable1 ( Name varchar(40) ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values('Chris'); Query OK, 1 row affected (0.48 sec) mysql> insert into DemoTable1 values('Robert'); Query OK, 1 ... Read More

AmitDiwan
1K+ Views
To generate a row index, use ROW_NUMBER(). Let us first create a table −mysql> create table DemoTable ( Name varchar(40) ); Query OK, 0 rows affected (0.49 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris'); Query OK, 1 row affected (0.14 sec) mysql> ... Read More