new to java plz hep me
hello all,
i'm new to java. i need to know answers to these questions..
1.What is the purpose of CLASSPATH? How 揷lasspath?is used by 慾ava?and 慾avac?
2.What is the purpose of finally block?
3.What is 慉nt?
4.Explain the difference between abstract class and interface. When to use an abstract class and when to use an interface?
5.What is the purpose of 朮ms option of 慾ava?
6.What is the main difference between java.util.Date class and java.util.Calendar class?
7.What are the differences between wait and sleep methods?
8.What is the advantage of using ArrayList over Vector?
9.Explain the word 慶asting?br>
could u plz help me.. i need them very much..
> 1.What is the purpose of CLASSPATH? How 揷lasspath?br>> is used by 慾ava?and 慾avac?
Classpath is the paths along which javac or the jvm searches for classes to load.
> 2.What is the purpose of finally block?
Cleanup if something went wrong
>
> 3.What is 慉nt?
Ant is a preprocessor, kinda like .bat files.
>
> 4.Explain the difference between abstract class and
> interface. When to use an abstract class and when to
> use an interface?
You should really google this. It's hard to answer this in 1 line
>
> 5.What is the purpose of 朮ms option of 慾ava?
Increase the java heap size
> 6.What is the main difference between java.util.Date
> class and java.util.Calendar class?
RTFM http://java.sun.com/j2se/1.5.0/docs/api/
>
> 7.What are the differences between wait and sleep
> methods?
sleep sleeps. Wait and Notify work together in multithreaded apps.
>
> 8.What is the advantage of using ArrayList over
> Vector?
It is faster
>
> 9.Explain the word 慶asting?br>
In the harry potter sense of the word?
Object o = "hi";
String s = (String) o;
i would like to add few more information to what tjacobs01 has added
2. when an exception occurs and u wont handle it ,the program terminates.u can use catch block to handle exceptions ,after the content in catch block is executed the remaining part is excluded.if u use finally after catch block after catch block is executed finally block is executed,in finally u can do some cleaning up operations such as closing a jdbc conenction etc
6.
i) a abstract class can contain a filled method ,in interface all methods are abstract by nature(ie only empty methods)
ii) A class must be abstract if the abstraction it represents is so general that it needs to be specialized in order to be of practical use.
in case of interface abstraction is fully general.
iii) both can not be instantiated,by default interface is abstract no need to use the keyword abstract