This is the new blog I have created and soon will be moving to this one !!
http://technoticles.wordpress.com/2010/01/15/thoughts-on-code-review/
This is the new blog I have created and soon will be moving to this one !!
http://technoticles.wordpress.com/2010/01/15/thoughts-on-code-review/
Determine the operating system bit count
Locate the operating system that is running on your computer in this section, and then follow the steps to determine the bit count of your operating system.
Windows Vista
If you have Windows Vista, there are two methods to determine whether you are running a 32-bit or a 64-bit version. If one does not work, try the other.
Method 1: View System window in Control Panel
1. Click Start
Collapse this imageExpand this image
Start button
, type system in the Start Search box, and then click system in the Programs list.
2. The operating system is displayed as follows:
* For a 64-bit version operating system: 64-bit Operating System appears for the System type under System.
* For a 32-bit version operating system: 32-bit Operating System appears for the System type under System.
Method 2: View System Information window
1. Click Start
Collapse this imageExpand this image
Start button
, type system in the Start Search box, and then click System Information in the Programs list.
2. When System Summary is selected in the navigation pane, the operating system is displayed as follows:
* For a 64-bit version operating system: x64-based PC appears for the System type under Item.
* For a 32-bit version operating system: x86-based PC appears for the System type under Item.
If you cannot determine the operating system bit count with these methods, go to the “Next Steps” section.
Windows XP
If you have Windows XP, there are two methods to determine whether you are running a 32-bit or a 64-bit version. If one does not work, try the other.
Method 1: View System Properties in Control Panel
1. Click Start, and then click Run.
2. Type sysdm.cpl, and then click OK.
3. Click the General tab. The operating system is displayed as follows:
* For a 64-bit version operating system: Windows XP Professional x64 Edition Version appears under System.
* For a 32-bit version operating system: Windows XP Professional Version appears under System.
Note is a placeholder for a year.
Method 2: View System Information window
1. Click Start, and then click Run.
2. Type winmsd.exe, and then click OK.
3. When System Summary is selected in the navigation pane, locate Processor under Item in the details pane. Note the value.
* If the value that corresponds to Processor starts with x86, the computer is running a 32-bit version of Windows.
* If the value that corresponds to Processor starts with ia64 or AMD64, the computer is running a 64-bit version of Windows.
If you cannot determine the operating system bit count with these methods, go to the “Next Steps” section.
Windows Server 2003
If you have Windows Server 2003, there are two methods to determine whether you are running a 32-bit or a 64-bit version. If one does not work, try the other.
Method 1: View System Properties in Control Panel
1. Click Start, and then click Run.
2. Type sysdm.cpl, and then click OK.
3. Click the General tab. The operating system is displayed as follows:
* For a 64-bit version operating system: Windows Server 2003 Enterprise x64 Edition appears under System.
* For a 32-bit version operating system: Windows Server 2003 Enterprise Edition appears under System.
Method 2: View System Information window
1. Click Start, and then click Run
2. Type winmsd.exe, and then click OK.
3. When System Summary is selected in the navigation pane, locate Processor under Item in the details pane. Note the value.
* If the value that corresponds to Processor starts with x86, the computer is running a 32-bit version of Windows.
* If the value that corresponds to Processor starts with EM64T or ia64, the computer is running a 64-bit version of Windows.
If you cannot determine the operating system bit count by using these methods, go to the “Next Steps” section.
The static block is only loaded when the class object is created by the JVM for the 1st time whereas init {} block is loaded every time class object is created. Also first the static block is loaded then the init block.
public class LoadingBlocks {
static{
System.out.println("Inside static");
}
{
System.out.println("Inside init");
}
public static void main(String args[]){
new LoadingBlocks();
new LoadingBlocks();
new LoadingBlocks();
}
}
Output:
Inside static
Inside init
Inside init
Inside init
it is part of my assignement..
public class Set<T> {
private T arrayElement[];
int size =0;
public Set(){
this.arrayElement = null;
}
public Set(T[] element){
arrayElement = element;
size = arrayElement.length;
}
/**
*add element to set. A check is made to identify whether element is present or not.
*If not the element can be inserted.
* @param element
*/
public void addElement(T element){
if(!contains(element)){
if(size == arrayElement.length){
incrementArray();
}
arrayElement[size++] = element;
}
}
/**
* to check is element is present or not.
* @param elem
* @return boolean
*/
public boolean contains(T elem){
if (elem == null) {
for (int i = 0; i < size; i++)
if (arrayElement[i]==null)
return true;
} else {
for (int i = 0; i < size; i++)
if (elem.equals(arrayElement[i]))
return true;
}
return false;
}
/**
* return the size of set.
* @return int
*/
public int size(){
if(arrayElement != null){
return arrayElement.length;
}else
return 0;
}
public void clear(){
arrayElement = null;
}
public String toString(){
if(arrayElement == null || arrayElement.length ==0 ){
return“[EMPTY]”;
}else{
String toStr=”[“;
for(int i=0;i<arrayElement.length;i++){
toStr+=arrayElement[i]+”,”;
}
toStr+=”]”;
return toStr;
}
}
/**
* to check whether set is empty or not
* @return
*/
public boolean isEmpty(){
if(arrayElement == null || arrayElement.length ==0 )
return true;
else
return false;
}
/**
* this function is used to increment the size of an array
*
*/
private void incrementArray(){
T[] temparray = arrayElement;
int tempsize=size+5;
arrayElement =(T[]) new Object[tempsize];
System.arraycopy(temparray, 0, arrayElement, 0, size);
}
}//Set class ends
This is the best article i have seen on concurrent hashmap. Very well explained.
Concurrent hashMap