Short Java Programming Questions

How can we open the outlook express using java code?

Here is code to invoke the Outlook express......in Java...I have done this..In one of my application:  *-- Vinayak

 *try
 {
   Runtime r = Runtime.getRuntime();
   String path1="cmd /c start outlook";
   Process p = r.exec(path1);
   if (p == null)
   {
      System.out.println("Could not connect");
   }
   in = new BufferedReader(new InputStreamReader(p.getInputStream()));
   String line;
   while ((line = in.readLine()) != null)
   {
     System.out.println(line);
   }
  in.close();
 }
 catch (IOException io)
 {
  System.err.println(io.toString());
  }*

What is the difference between normalServlet and ActionServlet?

This question could have a long list of differences to talk about. Answer would depend on what aspect you talk about.
1) Normal Servlet can simply run in a servlet container. Action Servlet would need Struts framework.
2) Normal Servlet is based on SR-000154 Java Servlet 2.4 Specification where as ActionServlet is Apache's implementation.
3) A servlet would have get doGet/doPost method implemented, in ActionServlet we might just use the default implementation.
4) In a web application numerous servlets can exist. ActionServlet provides the "controller" for the web app so its a possibility that even big applications have just on instance on ActionServlet.

What is join( ) method in thread and give a suitable program?

In Threads it waits for the thread to die

What is the  modifer of DefaultConstructer that takes by the JVM and Why? We know constructer cannot be overriding.  A method cannot be overtridden when it is declarded private or final.  I think the modifier of default constructer is private but I am not sure, I confused .

JVM makes up no args constructor by default Only if no other constructor is defined. Accessor is not private for default constructor.

For example

if you have a class Person defined as below

public class Person {
}

Then you can create object of Person type as
Person p = new Person();

but if you modify Person class as below

public class Person{
  public Person(String name) {}
}

Then you can not create object of Person type as
Person p = new Person();

But this does not imply that no args constructor is private. You simply haven't defined one. Though if there are no constructors in a class JVM creates default constructor on its own which takes no args

Tips by : CK

Related:

Java Books
Java Certification, Programming, JavaBean and Object Oriented Reference Books

Return to : Java Programming Hints and Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.