tapan hoskeri

Greenhorn
+ Follow
since Jul 16, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by tapan hoskeri

Tom,
What Michael is saying is brilliantly subtle, and true. This is not the place to ask for ready-made 'projects'. There are lots of gurus who will willingly share their expertise, if you are stuck with something though...for everything else, there's always Google.
18 years ago
I think Abhishek is right in saying that only 2 objects are created for the given example.

I just checked the hashcodes of the strings by adding the below to the provided code.

System.out.println(s1.hashCode());
System.out.println(s2.hashCode());
System.out.println(s3.hashCode());
System.out.println(s4.hashCode());

Which returned the following values when run on my machine
69609650
69609650
-728040823
-728040823

So there will be 2 objects created in all...
yes, I think that the object would be eligible for Garbage Collection, once the method m1 finishes execution.
Creating an object effectively means 'instantiating an object of a said class', so the terms are interchangeable. The Class.forName() method is an alternative to calling 'new' as far as object creation goes.

For eg, both the following lines of code do pretty much the same thing...that is to create an object of the class String

try
{
String a = (String)Class.forName("java.lang.String").newInstance();
//Creates an object of class String
}
catch (InstantiationException e)
{
e.printStackTrace();
}
catch (IllegalAccessException e)
{
e.printStackTrace();
}
catch (ClassNotFoundException e)
{
e.printStackTrace();
}


String b = new String(); //also creates an object of class String
18 years ago
The problem is with the single backslash characters used in the path you have specified. You will have to 'escape' the single backslash 'special character' with another backslash. The below line should work...

File myFile = new File("C:\\Program Files\\Java\\jdk1.5.0\\bin");
18 years ago
shiva,
Click here for a fantastic article, which explains all you need to know...
The service() method is usually overriden when you are using a 'GenericServlet'.

If you are using an 'HttpServlet', then the service method handles the delegation of the HTTP request received to one of the appropriate doXXX methods which are defined in the HttpServlet implementation. The Java API Docs mention this in detail, suggest you look them up here...
18 years ago
Marc, thanks a ton for putting that link up. Was just what I was looking for.

Pramod, both Sara and Marc are absolutely right. Having a Java certification does not guarantee you a job...in my opinion, it's an excellent way to cement your basics, this definitely helps in clearing interviews and technical tests. Most companies have not yet switched on to Java 5.0, have read on earlier posts here that people generally wait for a major software release like 5.0 to stabilize before porting their systems on to something new.
Hi Rekha,

I do not think a 'System.out.println' is permitted in the place where you have put it. A class definition can have only instance variables and methods.

If you want to print the value at the point you have mentioned, one of the ways of doing it would be as

public class TClass
{
int noOfdays = 7 * NO_OF_WEEKS; //1
public void sop()
{
System.out.println("noOfdays : " + this. noOfdays); //2 - Enclose this in a method
}
static int NO_OF_WEEKS = 52; //3
public static void main(String args[]) //4
{
TClass obj1 = new TClass();
System.out.println("noOfdays : " + obj1.noOfdays);
System.out.println("NO_OF_WEEKS : " + NO_OF_WEEKS);
obj1.sop(); //call the method once the object is created

}
}

Hope this helps!
First up, apologies for asking the same old question again. After trolling through the posts on here, I could gather that there is no word yet from Sun regarding this. I couldn't find anything on Sun's website too. I wanted to give SCJP 5.0, but the lack of 'hard copy' exam-oriented material is throwing my schedule slightly out of gear. So I was thinking of giving SCJP 1.4, and then the SCWCD which is more within my line of work. Also, we've yet to migrate to Java 5.0 at work, we still use 1.4.

Does anyone have any concrete info?

Thanks,
Tapan
Gagan,

The book will not be 'released' in India, I had contacted the publisher for the same. You will have to order it from the US through them, by paying the equivalent of the price in US Dollars.

As per the Indian office, the release date is 2nd November, 2005.