- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Maruthi Krishna has Published 952 Articles
Maruthi Krishna
940 Views
The static methods belong to the class and they will be loaded into the memory along with the class. You can invoke them without creating an object. (using the class name as reference).Examplepublic class Sample{ static int num = 50; public static void demo(){ System.out.println("Contents ... Read More
Maruthi Krishna
5K+ Views
The static methods belong to the class and they will be loaded into the memory along with the class. You can invoke them without creating an object. (using the class name as reference).Examplepublic class Sample{ static int num = 50; public static void demo(){ System.out.println("Contents ... Read More
Maruthi Krishna
2K+ Views
When you compile a program if you see this error it indicates that either you have not installed Java in your system properly or, you haven’t set the Path variable.The Path variable − The path environment variable is used to specify the set of directories which contains executional programs.When you ... Read More
Maruthi Krishna
813 Views
You can find whether a particular exists in a given array using any of the search algorithms. Here, we will see examples for linear search and binary search.Linear searchIterate through the array.Compare each element with the required element.import java.util.Scanner; public class ArraySearch { public static void main(String[] args) { ... Read More
Maruthi Krishna
266 Views
An array is a data structure/container/object that stores a fixed-size sequential collection of elements of the same type. The size/length of the array is determined at the time of creation.The position of the elements in the array is called as index or subscript. The first element of the array is ... Read More
Maruthi Krishna
2K+ Views
Array is a container which can hold a fix number of items and these items should be of the same type. Most of the data structures make use of arrays to implement their algorithms. Following are the important terms to understand the concept of Array.Element − Each item stored in ... Read More
Maruthi Krishna
1K+ Views
To find continuous sub array whose sum is equal to a given number −Iterate through the array.At each element add the next n elements one by one, when the sum equals to the required value print the sub array.Exampleimport java.util.Arrays; import java.util.Scanner; public class sub_arrays { public static void ... Read More
Maruthi Krishna
2K+ Views
To separate zeros from non-zeros in an integer array, and push them to the end, you need to rearrange it array by assigning all the nonzero elements to its positions, sequentially, starting from zero. Then, from last position of the array to its end populate it with zeros.ExampleFollowing Java program ... Read More
Maruthi Krishna
803 Views
In Java, serialization is a concept using which we can write the state of an object into a byte stream so that we can transfer it over the network (using technologies like JPA and RMI).To serialize an object −Make sure the class implements the Serializable interface.Create a FileOutputStream object representing ... Read More
Maruthi Krishna
15K+ Views
If a single number is missing in an integer array that contains a sequence of numbers values, you can find it basing of the sum of numbers or, basing on the xor of the numbers.Based on the sum of the numbers −The sum of n sequential numbers will be [n*(n+1)]/2. ... Read More