Usage of ‘this’ keyword in java
It always holds the reference of the current object.It can be used in the following situations 1.this can be used to refer current class instance variable. 2.this can be used to invoke current class...
View ArticleStatic Properties and Methods
Static Properties 1.It will be created commonly only once for all objects. 2.It will be initialized only once when the first object is created , further initialization is not permitted. 3.It is...
View ArticleArray Manipulation
Array is a finite collection of similar datatype arranged in a adjacent manner. Array Syntax Method – 1 datatype arrayname[]=new datatype[size]; Method – 2 datatype arrayname[]; arrayname=new...
View ArticlePrint ‘N’ Numbers in Reverse Order Using Array
The following java program gets ‘n’ numbers from user and prints the same in reverse order using array. import java.io.*; class PrintNReverse { int n; int a[]; BufferedReader br; void get()throws...
View ArticleSorting In Ascending Order Using Array In Java
The following java program arranges a collection of numbers in ascending order using array. import java.io.*; class Ascending { int n; int c; BufferedReader br; int a[]; void get()throws Exception {...
View ArticleSorting In Descending Order Using Array In Java
The following java program arranges a collection of numbers in descending order using array. import java.io.*; class Descending { int n,c; int a[]; BufferedReader br; void get()throws Exception {...
View ArticleFind the biggest of ‘n’ numbers using array in java
The following java program finds the biggest number in a collection of array. import java.io.*; class BiggestOfArray { int n; BufferedReader br; int a[]; void get()throws Exception {...
View ArticleSearch a number from an array in java
The following java program to search a number from a collection of numbers in an array. import java.io.*; class Search { int sno,n; int a[]; BufferedReader br; void get()throws Exception {...
View ArticleMatrix Generation Using Array
The following java program generates matrix using two dimensional array. import java.io.*; class Matrix { int r,c; int a[][]; BufferedReader br; void get()throws Exception { System.out.println("Enter...
View ArticleMatrix Addition Using Array
The following java program is to add two matrices using array.It is also an example of two dimensional array. import java.io.*; class MatAdd { int m[][],r,c,i,j; BufferedReader br; void get(int p,int...
View Article