Ashok Ujeniya

+ Follow
since Oct 03, 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 Ashok Ujeniya

hi Venu
hi Jane
Thank you for showing interest
You both are perfectly right.I must continue with java
thank you again.
hi Sandeep
Yes some qsn were tricky.50% qsn were lenthy.
but I feel that time,i.e.90 minutes is less.
Hello everybody,
today I passed SCJP with 66% score in first attempt.
I am a non IT profetional.
I am a constant visitor of Javaranch Forum and I learned lots of basic from this forum. Special thanks to all moderators for the quality of discussion.(Maha anna !)
I am happy that I passed exam but nervous because I scored less percentage.
but I know the reason and it is new time limit(90 minutes), big codes
and multiple choice.As I saw at watch after finishing 30 ques 60 minutes were I was left with only 30 minutes for remaining 29 ques and must have mistake while giving ans for this ques. I am able finish 57 ques---so be aware of time limit and work very hard.
I basically prepared from RHE, bill bro. I gave 10-12 mock exams. i practised lots of code.
Exam questions were good and evenly distributed according to the objective. I found 3 questions same as in some mock exam. I did not
get socket, mediatracker and gridbaglayout questions.
The distribution of questions was:
6 on i/o
3-4 operator and assignment.
1 garbage coll.
4-5 util package.
3-4 awt package.
10-11 overloading/overrinding.
2-3 thread.
5 on flow control exeception.
can anybody tell me what should I do next?
good luck to all who are going to take this exam.
thank you all again.
hi Kishan,
hi Jon,
Today I learned a lot.
widening conversion of reference,
widening conversion ofnull,
and lot more.(more specific-most specific)
i have tried your code.Doesn't it a example of widening convertion ?
when i say test.tester(c);
and i have two overloaded methods public void tester(B b)
public void tester(A a)
compiler makes c more wider for us and choose
public void tester(B b) c---b----a
(Mr.compiler is kind !)
when i say test.tester(c);
and i have only one method public void tester(A a)
compiler performs wider conversion and executes public void tester(A a)
when i say test.tester(null);
and public void tester(Button b)
public void tester(Object o)
public void tester(MyButton my)

compiler have no promlem with this and
public void tester(MyButton my) is executed. as null---my---b---- ---o
but when i say test.tester(null);
and public void tester(Button b)
public void tester(Object o)
public void tester(MyButton my)
public void tester(String s)
compiler is now confused(yes Jon two candidates!)
compiler says my frind be more speific and tell me exactly which method i should choose for you
please correct me if i am wrong

hi B,
your question is
What will happen when you attempt to compile and run the following code
1. class Base{
2. public void Base(){
3. System.out.println("Base");
4. }
5. }
6. public class In extends Base{
7. public static void main(String argv[]){
8. In i=new In();
9. }
10. }
ans.2) Compilation and no output at runtime
remove void from line 2 and you will get ans.3)Output of Base
because look carefully at line 2 it is method Base() with void return( it is not constructor as contructor doesn't have any return type)
yes compiler give us default constructor at no cost
(absolutly free !)if and only if class does not have any constructor and it is
class Base{
access modifier of constructor will be same as that of class. in this case it is default.
Hope this helps,

hi kishan,
At this time i read your question carefully.
how compiler know null is a string ??
how does the function having string argument is
decided to be the most specific method.

i refered jls and got ans.
jls says
"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".

so compiler knows that null means set of ASCII characters(string ?)

hi Kishan Kumar
I have copyed your code by cut/paste method.
it is bellow.(line no. are added by me).
1. class out {
2. //out() {}
3. static class inner extends outer {} //NOTE,extends outer which
4. } is a subclass of out
5. public class outer extends out{
6. public static void main(String s[]) {}
7. }
at line no. 2 you have commented constructor
at line 4 you haven't put comment
I suggest you to remove comment from line 2 and put comment at 4 line after curly braket .Now try to comply it. I think it will comply now.