Posts

Showing posts from February, 2017

Excel VBA Tricks

Image
If you are working in Excel and want to make your work easy then today I am providing some VBA tricks and from these few lines of can definitely divide your task in to small chunks. So now without wasting your and my time I am coming to the point. Here I am discussing Some tricks    Find Number of tabs between two tabs using Excel VBA   Find Empty Sheet using Excel VBA             Find header of sheet using Excel VBA Find Number of tabs between two tabs using Excel VBA  I am providing  a simple trick by which you can perform this task easily for this purpose I am using excel index function , As we know that index function provides number of that tabs like  This is my working sheet as given below and I want to know index value of given sheet then I will write down few lines of code and it will provide me index value of that sheet as shown below Sheet shows I am working inside tab1 and if I want to know index value of that tab then I will perform this operati

Euclidean Algorithm with Example in Java

Image
Euclidean Algorithm is a way to finding GCD (Greatest Common Divisor) of two integers quickly. If we have two integers (A, B) and we want to find out gcd(A,B) then Euclidean Algorithm is one of the best technique. Application Of Euclidean Algorithm For finding GCD of two numbers Euclidean Rythms : developed by GodFried Tourssaint in 2004 and described in a 2005 paper "The Euclidean Algorithm generates Traditional Musical Rhythms. The Algorithm If A=0 then GCD(A,B)=B since GCD(0,B) and we can stop If B=0 then GCD(A,B)=A since GCD(A,0) and we can stop Example: import java.util.*; public class EuclideanAlgorithm { public static void main(String arg[]) { Scanner sb = new Scanner(System.in); int a, b, q, r; System.out.println("Enter value of A :"); a = sb.nextInt(); System.out.println("Enter value of B :"); b = sb.nextInt(); if (a == 0) { System.out.println("gcd(&qu

Wrapper Class in Java

Image
J ava is Object Oriented Programming language and can be view everything as an object i.e. a file can be treated as an object,  image can be treated as an object and similarly primitive data type which are not object  can be treated as an object (with Wrapper class). In simple way we can define Wrapper class is a mechanism to convert primitive data type into an object and also an object in to primitive data type . for example : Suppose num1 is an ineteger variable like this int num1; we want to create an object of num1 then with help of wrapper class it is possible i.e. we can create an object of  num1 of its corresponding wrapper class Integer like this Integer n1 =new Integer(10); num1=n1; Note  : java.lang package contains Wrapper classes The eight classes of  java.lang  package are known as wrapper classes in java, following table Contains Primitive data and  its corresponding wrapper class. Primitive Data Type