Kashif Sayyed

Greenhorn
+ Follow
since Dec 18, 2007
Merit badge: grant badges
For More
Mumbai
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 Kashif Sayyed

Congrats Luis, Great score...
14 years ago
Congrats...
14 years ago
Once again Thanks to all of you guys for appreciating me on my SCJP success...

James,
Please dont ask for any --- here on this forum, because we all on this forum dont use such short cuts to clear the exam...
Even if you clear the exam with help of such ---, it'll not help you much in your professional life..
So my advise is to please read K&B and solve Devaka's mock exams, it'll surely help you to clear exam as well as in your
professional life ..

Wish you the Best Luck for your exam preparatin..


Thanks,
Kashif.
14 years ago
Hi,

I have cleared the SCJP 5.0 on last weeked with 83%, not expected in just 3 weeks of study.
Hats off to Cathy & Bert for writing wonderful book and Devka for his exam simulator which helped me a lot.
I didnt like reading books but i am enjoying reading this K&B book and looking forward for next book Head 1st Servlet Jsp by K&B.

Thanks to all on this forum as well. Whenever i have any doubts i have checked on this forum and found the solution with details.

Thanks
Kashif.
14 years ago
I was also bit nervous becuase in Devka's practise tests ,I got following scores,

1st Test 40%
2nd 52%
3rd 58%
4th 62%

I am yet to give its final exam.

But reading comments in this blog, helped me to boost my confidence and i m going to take the exam this weekend.
Best luck to all of them who are giving exam in near future.
Adi thanks for your reply and you are correct, my questions are a bit confusing. Actually those are just observations i got from playing with some inner class codes. So i just wanted to confirm them.

himanshu,
thanks for reply.
your answer for point 1 is wrong. Outer class can be normal or abstract if its inner class declared abstract.
And about point 3, it is not dengerous to directly use instance variables of outer class in concrete class of inner class because as adi said "Subclass of inner class is as good as a member of the Outer class . So it can access the instance variables of the Outer class. ".


thanks.

The code shown here is from K&B chapter-8:Inner Classes, SelfTest Q No:12




from above example and the K&B book, i have understood some points about abstract regular inner classes, please verify whether is it correct or not.

1. If we make regular inner class as abstract then it is not necessary to make my outer class as abstract. It can be a normal class or an abstract class.

2. While making concrete subclass of my inner class either in same outer class or some other class, i shud have an instance of my outer class. For other classes, my outer class as well as my inner class shud be visible for them to make concrete subclass of my inner class.

3. Now concrete sub class of my innner class can access the instance variables of my outer class depending upon their visibility to concrete subclass.

4. If my concrete subclass of inner class is written in static method then this subclass cant access the instanse variables of my outer class using Outer.this reference.

Please correct if any of above my understanding is wrong.

Thanks in advance.

The correct answer is,

void k_method( ) throws Exp { => k_method shud either handle or declare exception thrown in v_method


void k_method( ) { => it will not compile as it doesnt declare or handle exception thrown in v_method

void k_method( ) throw Exp { => throw keyword can not used to declare exception,it shud be throws

void k_method( ) assert Exp { => wrong method declaration

void k_method( ) try Exp { => wrong method declaration
Add one more parameter e.g. str_flg to makeSpecCOObjects method to diffrentiate between strColumnName1 and strColumnName2.

before making call to makeSpecCOObjects method, just change the value of str_flg as given below,

str_flg=false; //for 1st call=> makeSpecCOObjects(alTotalObjects, type1, strColumnName1, strColumnName2, vEms7501CiLnConsSpec);
str_flg=true; //for 2st call=> makeSpecCOObjects(alTotalObjects, type1, strColumnName2, strColumnName1, vEms7501CiLnConsSpec);
makeSpecCOObjects(alTotalObjects, type1, strColumnName1, strColumnName2, vEms7501CiLnConsSpec,str_flg);

And modiy makeSpecCOObjects method body as,

if(str_flg==true){
String tempString = strColumnName1;
strColumnName1 = strColumnName2;
strColumnName2 = tempString;
}

In above solution, i have assumed that you can modify the defination of makeSpecCOObjects method. In that case this solution will resolve your problem.