The Artima Developer Community
Sponsored Link

Java Answers Forum
Few java doubts...Please clarify...

4 replies on 1 page. Most recent reply: Jun 3, 2008 1:53 AM by vannur basha

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
Zenwalker :)

Posts: 1
Nickname: zenwalker
Registered: Feb, 2007

Few java doubts...Please clarify... Posted: Feb 23, 2007 6:25 AM
Reply to this message Reply
Advertisement
First of all i would like to really be thankful for Mr. Eckel for giving us a great book about Java (Thinking in Java). I am reading Thinking in java 3rd edition and i have a great time with it..His explainations and words rocks me and makes me waste ;) my time with it for most of the time....


Now i have simple doubts...

1) In a site called orkut.com we are having alot of arguments about the value representation of NULL (null actually) in java. In the book he has shown that null='\u000'. But many of them there ague that value differs based on the VM implementation and the one who implements it. The value can vary across platforms...So is this true or the \u0000 remains same regardless of what platform or whoever the implementer is??

2) Is Java language provides 100% deployment features?? I mean does it provide a feature called write once and run any where with out changing any bit of the java code??
Coz say if i am developing some application using java on Linux machine. So if i access the underlying filesystem file say a some user.conf file in /home/zenwalker/user.conf file..And if i port this application to the stupid windows machine do i have to change the file path in the source code to some say c://Program file/user.conf (if assumed that user.conf is the OS file and present in these locations) or in other word if i am trying to execute some OS command say listing directory using ls command in unix/linux machine and if i port it (my project) to stupid windows machine, do i need to change this to dir command where ever i have used ls command or any system command as a matter of fact...If this is not true, then how JVM handles this differences...

Thanks


Dave Lorde

Posts: 8
Nickname: dlorde
Registered: Aug, 2005

Re: Few java doubts...Please clarify... Posted: Feb 24, 2007 1:16 AM
Reply to this message Reply
The language specification is where null is defined, and it says "There is also a special null type, the type of the expression null, which has no name. Because the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type. The null reference is the only possible value of an expression of null type. The null reference can always be cast to any reference type. In practice, the programmer can ignore the null type and just pretend that null is merely a special literal that can be of any reference type".

and

"The null type has one value, the null reference, represented by the literal null, which is formed from ASCII characters. A null literal is always of the null type".

Rather a circular sounding definition, but the value of null is the null reference itself - just another pointer. The value of the null reference isn't really relevant and is presumably up to the implementor, but zero or some other value that can't be confused with another object address is likely.

Confusion may be caused here because there is a character value called the 'null character' with value '\u0000'. This is the default value for type char.

Dave Lorde

Posts: 8
Nickname: dlorde
Registered: Aug, 2005

Re: Few java doubts...Please clarify... Posted: Feb 24, 2007 1:25 AM
Reply to this message Reply
Java only knows about a limited set of platform independent directories which appear as Java system properties, so you can use those properties to locate certain directories:

java.class.path - Java class path
java.library.path - List of paths to search when loading libraries
java.io.tmpdir - Default temp file path
java.ext.dirs - Path of extension directory or directories
user.home - User's home directory
user.dir - User's current working directory

See System.getProperties()

vannur basha

Posts: 2
Nickname: vannursmca
Registered: May, 2008

Re: Few java doubts...Please clarify... Posted: May 27, 2008 12:17 PM
Reply to this message Reply
hai sir,

First i thankful to u for clearing our doubts in java.
sir i am not clearly understanding the property of classpath variable. plz giv a detail account on class path variable what is the importance and how it works

thank you very much sir,
yours
vannurs...

vannur basha

Posts: 2
Nickname: vannursmca
Registered: May, 2008

Re: Few java doubts...Please clarify... Posted: Jun 3, 2008 1:53 AM
Reply to this message Reply
sir,
i hav read in some book that the class which has the main method is compiled by interpreter and which clasess doesnt have the main method, those r compiled by compilers.
Is it right r not sir,and plz send the compilation process of java program

Flat View: This topic has 4 replies on 1 page
Topic: Corba retry mechanism Previous Topic   Next Topic Topic: How to compile a

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use