+ Follow
since Jan 09, 2000
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Venkat01

Which statements concerning the following code are true?
class A {
public A() {}
public A(int i) { this(); }
class B extends A {
public boolean B(String msg) { return false; }
class C extends B {
private C() { super(); }
public C(String msg) { this(); }
public C(int i) {}
Select all valid answers:
A) The code will fail to compile.
B) The constructor in A that takes an int as argument will never be called as a result of constructing an object of class B or C.
C)class C has three constructors.
D)At most one of the constructors of each class is called as a result of constructing an object of class C
Can anyone please explain this? This has been discussed earlier in javacert, but i did not get any concrete reply and hence is reposting the same here. Thanking everyone in advance.
I have the following doubts about applets. Whether the following are true or not

1 An applet can change the CODEBASE
2 An applet cannot call the update() method directly
In GridBagConstraints, if fill=fill.BOTH is selected, which variables listed below are irrelevant?
I feel that it should be anchor, since fill and anchor do not
go together. Am i right?
hi Tony,
I am sorry, but i am unable to see the red bulb as you say even after reading all the messages,closing the browser and again re-opening the same. BTW i am using Windows 98. See if you can help me. Also please go through my post on Constructors and reply back ASAP.
Thanking you
BTW - I am registered
Dear Paul, Tony
How do we read the new messages in individual posts. It is really not possible to go on checking each topic to see whether any new message is posted or not. It is not possible to know in which topic a new message is posted and we can go there directly.
Dear Tony,
"""the first thing done in constructor Test(int j) is a call to its super(); i.e., to its default superclass constructor. As you know, if you define as much as one "some-arg" constructor, you must define a no-arg one also, if it's possible that one will be called somewhere."""
Why should you define a no-arg one ""ALSO""?? I understand that when you have a arg Constructor, the no-arg Constructor is not provided. The whole concept of mine regarding Constructors has really started shakeing.
My point is that in the base class you have a arg-Constructor and in the derived class you can call the base arg constructor by using super(). Where does the point of CREATING NO ARGUMENT CONSTRUCTOR comes in to picture in the BASE CLASS?
I am sorry, tony, but please explain again.
Hi Tony, Jim, Frank
Everyone has talked about everything roundabout the world, but the question remains "WHETHER WE CAN GIVE ANOTHER VALUE TO THE FINAL VARIABLE (NOT NECESSARILY A BLANK VARIABLE)IN THE CONSTRUCTOR"
For the time being let us forget about Java 1.2 or Java 1.3. By the way when is Java 1.4++ coming (it will be a infinity loop - i do not know how to put the smile here).

But i definately remember seeing in javacert discussions that you can reassign a different value to the final variable in the Contructor (which was not possible in Java 1.1).
hi everybody,
Anyone please clarify the following.
3.Which of the following statements about threading are true?
A)You can obtain mutually exclusive lock on methods that
extends thread or implements runnable.
B)You can only obtain mutually exclusive lock on methods that
extends thread or implements runnable
C)You can obtain lock on any of methods. --true
D)You can obtain mutually exclusive lock on any of methods.
suprising, nothing about synchronised is there in the options.
Another silly question, but i am confused.
4.Which cannot be used in declaring and initializing an automatic (method call)
A. Final
B. Public --false
C. Constants of non-primitive type
D. Inner class from other scopes
E. Initialized arrays(such as "{Hello", "Goodbye"})
Thanking all.
hi everybody,
The following is a question from Simon Roberts
public class Test extends Base
public Test (int j)
public Test(int j, int k)
Which of the following forms of constructors must exist explicitly in the definition of the Base Class. The answer says
1) Base() {} // Default Constructor
2) Base (int j, int k) // Constructor with 2 arguments.
I understand the 2nd part, but how can a default constructor exist in the Base Class (becoz if we have a constructor with arguments, then there is no default constructor)???
The answer given is as under
" In the constructor at lines 2 and 3, there is no explicit call to either this() or super(), which means that the compiler will generate a call to the zero argument superclass constructor"
How will it call a zero argument superclass constructor, when it already have a constructor with 2 arguments (becoz if there is no constructor defined, then only there will be a zero argument constructor???)
Please explain the situation (or is my question damm silly and i am missing something?)>>
hi everybody,
I am sick of this final variable.
public class Test4
final static int i;

public Test4()
i =10;

static public void main(String arg[])
new Test4();
I am absolutely bamboozed with the 1st Error, which is as under.
'Blank Final variable `i' may not have been initialised. It must be assigned a value in an initialiser or in every constructor'
Then there is a second error which is as under:
'can't assign a second value to a blank final variable'.
From going through the discussion in, i had come to understand that in JDK 1.2 (or 2 whatever) we need not assign a value to the final variable and can do that in the constructor. What the hell is happening? Now my questions
1) Why is the compiler complaining when i do not initialise a final variable. I thought JDK 1.2 is better than JDK 1.1, where you had to mandatorily initialise a final variable.
2) When i initialise a final variable to 'final int i = 5' and try changing the same in the constructor, it again cries and says cannot assign a second value to a final variable.
Tony, Paul, Jim help me as i am already booked for 7th Feb for exams. Thanking you in advance.
Hi Paul,
Thanks for the reply. I know about the light bulbs in the top page. What i was referring is that once inside the programmer certification page, how do i know whether any new message have been added or not and is there any way to see only the new messages that have been added (something like marcus's site). That is really good. This is also good, but the only limitation is that i will have to go toall the topics and browse down to see if there is any new message. Even in, by just seeing the topic, i was able to decide whether to read it or not, which is not possible here. Please note that this is just a request.
Thanks every body for the reply and sorry for the typo. I promise to be more careful in future. Gentlemen, please understand that this is not deliberate.
Again thanks JIM, you have been wonderful. One small point, have you stopped answering posts in if so then there is no need to go there.
Hi Jim
So you have also shifted to group and thanks a lot for the reply. I had some doubts about accessing the new answers in the group. I had written to tony (since he is the official moderator) before and is waiting for the repy.
Will keep on troubling you again.
Hi Tony,
Congrats on becoming the moderator for this group. I have already bookmarked the main discussion page, but how do i know if some of the posts which i have made have a new reply or not. In javacert, since individual messages were there, it was easy to know. Also Marcus's new discussion site has a facility to check only the last day's message. How do we do it here?
Coming back to the question, how can you say only one object will be eligibe for GC (what about the assignment of name to Newestname, i think i am wrong here, but is damm confused). Also if i set Newname and Newestname to null, how many objects will be eligible for GC.
Sorry for the trouble, tony (this is a simple case, but it damm confusing) and thanking you in advance.
Dear Shivprasad,
So what is the answer. I am really confused. My only point here is that since java has already a awt package, if i create my own awt package, will the compiler allow and if it allows, which of the options are right.