ali kamran

+ Follow
since Apr 25, 2010
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 ali kamran

Seetharaman Venkatasamy wrote:Please, QuoteYourSources .

I read in Kathy sierra that variables are not inherited so came up with the example to do this and earlier had the i as protected to showcase i can be accessed only via constructor and nowhere else and then I thought what if we had a constructor that would call the i which would it print .To cut a long story short experiment with what I have iterated to this point .
Quick question as follows

Now I understand Variables are not inherited so gc1.i should print 1 which it does but why does the constructor print i as 9 from the grandchild ? Anyone,Thanks much appreciated.

carlos pertusi wrote:Hi,
In order for AJAX to work, a web server is required. In order to have server-side code running, you need a web server. I've put the examples files on my www folder of apache2 server and works fine.


Sir if you may be kind enough to share the Directory structure and how you deployed it .
For instance did you put the whole extjs folder(containing the html,js) inside the web content of the project ? or does it need to be in a paticular layout for it to work.

Raj k Sharma wrote:Dear Ali,
Please check your online and offline version again and confirm.
Raj Sharma

Thanks.The online version seems fine now but the offline version still has the issue.Please advise.
Thanks,online version seems good.Offline version still has the same issue.Still no response on the email,Tried reaching on the phone number ,No response.please advise

Raj k Sharma wrote:Dear Ali,
Thanks for posting your query,
Now our all products can be used by logging in our website with the same email id and password which you have used while registration, its no more activation code process now.
We are happy to inform that our all products can be used in online or offline mode.i.e you can either used the self study training by logging in our website and using online mode or you can download the offline version and use it anywhere without internet.
Also, we apologize for not replying as there is a weekend off at office and you will get the reply by monday on email.
Keep participating in this forum and best of luck for your exam.
Raj Sharma
Customer relations

Hey Raj,
Thanks for replying.As advised,logged in with same id,Only have the trial version option.Similar on the offline mode only trial version exist as option.Please advise.
Thanks for the wishes.Looking forward to learn from whizlabs.Thanks
Hey guys,
I bought the self study package from whizlabs.It's been a week since I bought this and I have not yet received the activation code.Tried calling their support number no response,Emailed their support team still awaiting a response .Does anyone know if there is a delay or so ??

Helen Ma wrote:Suppose you want to add string "2","4" ,"1" , "3" in this order to the priority queue, which implements heap sort.
1. The heap looks like this:

2. Add 4 and the heap looks like this:

3. Add 1, but 1 is small than 2 , so
3.1 1 is added as the right child of 2

3.2 1 moves up on the branch, like this:

4. Add 3 , the heap will be:
4.1 insert 3 to the next level

4.2 move 3 up as it is less than 4

Heap sort can be represented in an array. If so, the zeroth element is 1, first element is 3 , second element is 2 and forth element is 4.

Please verify this.

Thank you sooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo much .Much appreciated yeas that is how the elements came out.Thanks again

Seetharaman Venkatasamy wrote:*return null* is not only the option then....

May you please explain how return null is valid.Thank you

But I can't understand what's going on with your example.

That is what needs to be figured.Thanks though
Given this program what are the possible outcomes ? (Not necessarily guaranteed)
class Mayan extends Thread
static int strained=0;
public static void main(String[] args) throws Exception
Thread thread = new Mayan();
Thread thread2 = new Mayan();
Thread thread3 = new Mayan();
public void run()
strained += 2; System.out.print(strained + " ");

Options .Pick 2

1.) 2 4 6

2.) 4 4 6

3.) 4 2 6

4.) None of the above

5.) This program will not compile

6.) This program has a runtime error

Ans: (1)The 2 4 6 is a no brainier granted.

Probable Ans(2) Another answer is 4 2 6 thread goes in and sees increments the value to 2 but before the thread can print it another goes in and increments to 4 and print and then first one print and the finally 6.

Ans(2) " That is 4 4 6 is possible. This is because 2 threads may execute strained += 2 one after another.This will cause 4 4 to be output. The next thread will output 6. "

My ISSUE with ans 2 is if they execute one after another one would get a value of 2 while other would get a value of 4.How can they both have 4 ?

Henry Wong wrote:

ali kamran wrote:
Issue:/What I expected and what I got :
Now my question is if we were to change the Cert(intx) and Grade(int x) to be and Object as it is a copy is passed so when grade increments this would be reflected as 11 and the final sop would be 12 .So when I changed to Integer I still see same answer 11.

Got the first part. Correct. Can you elaborate what you are trying to say for the second part?


Hey Henry and gurpeet thanks for your efforts.what I was trying to state was shouldn't the result change for objects as opposed to primitive.If I modified my code to

class Grade
// Integer x=10;
Grade (dodo d){
System.out.println("inside method"+d.weight);
System.out.println("inside method"+d.weight);
// public Grade(){this(x); x++;}
public class Cert extends Grade
Cert(dodo d){super(d);
System.out.println("inside cert method"+d.weight);
d.weight++; System.out.println(d.weight);}

public static void main(String [] args)
dodo d = new dodo();
new Cert(d);

class dodo
static int weight;


I get 12 the expected result but why not for Integer which is also an object.Thanks guys ...
What is the output ?

Now my understanding is the static int does not come in picture.when new cert10 is created it passes the value to super that modifies it through Grade(int x) method but locally and then when it returns back to Cert(int x) the value is 10 and the sop display value after 10++ which is 11; Correct.
please advise

Issue:/What I expected and what I got :
Now my question is if we were to change the Cert(intx) and Grade(int x) to be and Object as it is a copy is passed so when grade increments this would be reflected as 11 and the final sop would be 12 .So when I changed to Integer I still see same answer 11.

please advise ..

[HENRY: fixed code tags]

Seetharaman Venkatasamy wrote:

ali kamran wrote:can somebody please explain why null is valid code fragment

null is an valid return type in this regard. by the way: what are the other options?

May you please elaborate "in this regards" ?.The correct answers is 2,3 and 4.The return type is of the same class or a sub is this and null subtype ?


1.) return new Object();

2.) return this;

3.) return new Marmaduke();

4.) return null;

5.) return "";
Given this code snippet, what can be inserted in the fragment ?

this is from certpal
can somebody please explain why null is valid code fragment