Saturday, July 30, 2011

Static methods Cannot be Over-ridden

U cannot over-ride the static method.If u do so the compiler wont give u ny error but the behaviour would certainly not the same.
Example

class T
{
static void  mth()
{
System.out.println("hiii static");
}

}
class Test extends T
{
static void mth()
{
System.out.println("overridding method");
}
public static void main(String []args)
{
Test.mth();
T.mth();
mth();
T obj=new Test();
obj.mth(); // here u should get d output as "overidding method " bt we get "hii static" as our output
}

}

Tuesday, July 26, 2011

Setting the classpath for first java Program

Step1:
right clk on computers->properties->advance system settings->environment variables.

Step2:
click on environment variables->classpath.



Step3:
After selecting classpath option,click on edit.
Step 4:
with adding semicolon at the end ,give the path upto bin where ur jdk is located.
click on OK.
Step 5:
Check ur settings by writing javac on command prompt.

Friday, July 22, 2011

Starting with struts in netbeans 6.5

To Start with first download the following plugins:

"org-netbeans-modules-web-frameworks-struts2.nbm" 
"org-netbeans-modules-web-frameworks-struts2lib20011.nbm"

Step 1


click on tools and click on plug-ins.

Under the option of downloaded plugin,browse the location where u hav stored ur plug-in and then click on OK. (tools->plug-ins->downloaded->open->finish)
Step 2:
Click on file and new  Project.


(File->new Project->java Web)
select the java Web ,Click Next.
Step 3: Choosing Web Server
Choose the web server.
netbeans have inbulit support of glassfish server.


Step 4:
Click on next.
then select the option Struts 2 .

Step 5:
Click on Finish.

Sunday, July 17, 2011

welcome

hiiiii..if someone wants ny help related to java can post here..