sivakumar
BAN USERvectors use a dynamically allocated array [Using malloc] to store their elements. This array may need to be reallocated [use realloc function] in order to grow in size when new elements are inserted, which implies allocating a new array and moving all elements to it.
- sivakumar February 01, 2014import java.io.*;
import java.lang.*;
import net.sf.ehcache.*;
public class Cachetest
{
public static void main(String args[])throws Exception
{
try
{
CacheManager a= new CacheManager();
a.create();
a.getInstance();
System.out.println();
}
catch (Exception e)
{
}
}
}
to access data through variable, program first get the memory location of the variable and then get that data but pointer contains the actual address location so it can go directly and fetch the data.In my opinion pointer is more faster.Correct me if i am wrong.
- sivakumar February 01, 2014
package finger; // another method
- sivakumar February 09, 2014import java.io.*;
class testq1
{
public static void main(String args[]) // 1 2 3 4 5
// 9 8 7 6
{ // 10 11 12 13
int n=29; // input
get_the_finger(n);
}
public static void get_the_finger(int n)
{
if(n>5)
{
n=n-5;
int row_dir =(n-1)/4;
if((row_dir)%2==0)
{
if(n%4==0)
System.out.println("A");
if(n%4==3)
System.out.println("B");
if(n%4==2)
System.out.println("C");
if(n%4==1)
System.out.println("D");
}
else
{
if(n%4==0)
System.out.println("E");
if(n%4==3)
System.out.println("D");
if(n%4==2)
System.out.println("C");
if(n%4==1)
System.out.println("B");
}
}
else
{
if(n%5==0)
System.out.println("E");
if(n%5==4)
System.out.println("D");
if(n%5==3)
System.out.println("C");
if(n%5==2)
System.out.println("B");
if(n%5==1)
System.out.println("A");
}
}
}