Labels

Thursday, March 17, 2011

How to check your system is 32-bit or 64-bit

Method 1 Click Start, then click on Run or Start Search.
Type msinfo32.exe and then press Enter key.
In “System Information”, review the value for the System Type item:
For 32-bit editions of Windows, the value of the System Type item is x86-based PC.
For 64-bit editions of Windows, the value of the System Type item is x64-based PC.

Method 2
Click Start, click Run, type sysdm.cpl, and then click OK.
Click the General tab. The operating system appears as follows:
For a 64-bit version operating system: Microsoft Windows XP Professional x64 Edition Version appears under System.
For a 32-bit version operating system: Microsoft Windows XP Professional Version appears under System.

Method 3
Click Start, click Run, type winmsd.exe, and then click OK.
In the details pane, locate Processor under Item. Note the value.
If the value that corresponds to Processor starts with x86, the computer is running a 32-bit version of the Windows operating system.
If the value that corresponds to Processor starts with ia64 or AMD64, the computer is running a 64-bit version of the Windows operating system.

Wednesday, March 9, 2011

Java basics ---Using Java Utilities

Consider a file you have created in java named "Hello.java".
(1) Javac(java compiler) -
used for compiling java file and producing .class file.
--use following  command line at shell prompt
javac Hello.java
--if the code is correct it will compile and it will create "Hello.class" file.
--to see  what javac is doing behindthe scenes use following command line
javac -verbose Hello.java

(2) java(java Interpreter) -
to run a .class file or  runing an application
java Hello
It will give output of your source code.
Note: no extension is needed when  invoking the interpreter.
--to view execution details of comipled code use command line
java-prof Hello

--this will generateThis will generate a profile which shows

->methods called in order of decreasing frequency.
->how memory is used.
->list of variable  and bytes necessary to store them.

(3) javadoc(javadocumentation)- generate source code documention
--To generate this documentation, use thecommand line 
javadoc Hello.java
---it generates four html documents:

1.packages.html,
2.HelloWorld.html,
3.AllNames.html,
4.tree.html.


-All methods including the main method(function) are inside classes.
-Every java application must main method except Applets.
-Signature of main method is:

public static void main (String args[])


• For the main method
– public is the access specifier.
– static is the storage class.
– void is the return type.
 String args[] is an array of strings
(4) jdb(java debugger)-
Sometimes the program compiles but does not work as intended.

• In this situation the java debugger can be used.

– to generate full debugging info use the
javac -g Hello

--> to invoke the  debuggeruse command line.
jdb HelloWorld
--To set a breakpoint, use the command
 stop in HelloWorld.main
followed by run
-- >When the breakpoint is hit, type
list
-- >to see the code,Type
clear HelloWorld.main
followed by cont


Java programs are commonly of two types

– Applications
– Applets
• A piglet is to a pig as an applet is to an application.
• Applications are stand-alone Java programs.
• Applets are programs that require a browser torun. Applets are typically downloaded from the
Internet and run in an applet window within a browser.