Win a copy of Terraform in Action this week in the Cloud forum!

Sandeep Nachane

Ranch Hand
+ Follow
since Dec 06, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sandeep Nachane

This are some points worth remembering !!
(1) try block without atleast one catch block or finally block after it gives compile error.
(2) Any exception thrown by the finalize method causes the finalization of that object to be stopped, but is not notified to the application and that object is still considered as finalized.

(3) Unlike constructors, which are chained from the subclass to superclass, finalizers are not implicitly chained. It is considered a good programming practice if you call the superclass finalizer like super.finalize() in your subclass.
-Sandeep
------------------
www.tipsmart.com
(i=3) is evaluated first and assigned before evaluated further. Hence the expression becomes j = 3 * 3 = 9
-Sandeep

------------------
www.tipsmart.com
Expression b += 1; is evaluated as
b = (byte)(b +1);
Hence it does not complain, as the cast is put for you by the compiler.
In your second code snippet.
byte c = (a+b);
Both a and b are promoted to int (numeric binary promotion) so the expression becomes
c = (int)a + (int)b;
If you do not cast it to byte, it becomes an error since you are trying to store int value in byte variable (i.e c)
-Sandeep Nachane
www.tipsmart.com

[This message has been edited by Sandeep Nachane (edited July 13, 2001).]
Susie,
All methods in an interface are automatically public (even though the modifier explicitly does not appear by the method). However while implementing the interface, you must declare the method as public. Otherwise compiler will assume that the method as default (package) visibility and will complain that you try to supply a weaker access privilege.
-Sandeep Nachane
www.tipsmart.com

[This message has been edited by Sandeep Nachane (edited July 13, 2001).]
Till now I was simply watching the discussion and was refraining myself from participating.For a long time I tried to be a saint, but now I cannot get over the urge for writing.
This behaviour may be acceptable in the part of the world you come from but is considered as theft in the country from which I come and I have been taught by my parents to condemn such things and I am proud to teach the same values to my kids.
I can almost be certain that all the people from whom you stole must have spent more time than you would even care to think of trying to put stuff together. I host my own website and I can
feel exactly what it would be to have some guy who has some knowledge of internet and html and lots of knowledge of dubious value, getting up one fine morning and publishing my work with his name stamped on it.
You have gone too far in the pursuit of overnight fame and if you call yourself professional then try to behave like one and earn your own credits. Just because your fellow brethren call it a good work does not mean anything.
I just want to keep it short since I have better things to do in life.
Moderators, If some body makes me angry, i tend to go overboard in replying to them. I apologize if that has happened here.
-Sandeep Nachane www.tipsmart.com
[This message has been edited by Sandeep Nachane (edited July 12, 2001).]
It will return false. Check it out..

------------------
www.tipsmart.com
You may want to try the self review q's on Object Equivalence at my site
http://www.tipsmart.com/studytools/selfreview/objequiv.htm
-Sandeep
If you want to instantiate the subclass object and use any method in it.. then yes, you must implement all the methods of the abstract superclass
------------------
www.tipsmart.com
The point here is that there are no non-static inner,
local or anonymous interfaces (unlike classes).
See the example below.
When you define top-level nested class B, it is defined as static member of the enclosing top -level class A, but when you define an interface, explicit static declaration is not needed and in that sense interfaces are implicitly static .

-Sandeep

Originally posted by April.Johnson:
From JLS 9.1.1.1: "Every interface is implicitly abstract."
From JLS 9.1.1: "The access modifier static pertains only to member interfaces."
So interfaces are implicitly abstract, not implicitly static.
Also you can have inner interfaces, referred to in JLS 9.1.1 as "member" or "nested" interfaces. (Also JLS 8.5 says: "A member interface is an interface whose declaration is directly enclosed in another class or interface declaration.")
Sandip is correct. From JLS 9.1.4: "All interface members are implicitly public."
As for why you'd use an inner interface, I haven't run across a situation that would warrant it, so I can't give you a real-world example.
April


------------------
www.tipsmart.com
[This message has been edited by Sandeep Nachane (edited June 21, 2001).]
There is nothing like an inner interface. Interfaces are implicitly static
-Sandeep
------------------
www.tipsmart.com
James,
If a continue statement with label identifier (label1 in your example) do not have a immediately enclosed statement
as while, do, or for statement than compile-time error occurs
Keeping above JLS rule in mind, In your example if you put statement (B) then it will contradict the rule mentioned above. hence option B is incorrect.
In fact option A is also incorrect. It will also give compile error by the same token
Have you tried compiling the code ? I tried using JDK1.2.2
-Sandeep Nachane
www.tipsmart.com


[This message has been edited by Sandeep Nachane (edited June 06, 2001).]
Hi All,
I have collected a list of about 60 websites dedicated to Career/Job/Resume etc and put on my website. Some of you might find them useful.
The URL is
http://www.tipsmart.com/miscjava/jobsites.htm
If you know more you can post those in this thread.
Thanks
-Sandeep Nachane
20 years ago
Sam,
When you declare a method as abstract, you agree to imlement that method in the subclasses by overriding it. On the contrary static methods cannot be overridden (they can only be hidden in the sub classes). Thus static and abstract combination leads to a potentially contradictory situation and hence is tagged as error.
I have made some useful notes on such conditions. You may find it useful http://www.tipsmart.com/studytools/revtips.htm
Sandeep Nachane
------------------
www.tipsmart.com
[This message has been edited by Sandeep Nachane (edited April 27, 2001).]