Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Vidya Shivram

Ranch Hand
+ Follow
since Jun 11, 2017
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 Vidya Shivram

why protected member will not be accessible in the subclass outside the package by using parent class reference variable ?
I see many saying it is Java rule/imposition on protected modifier but I wish to know why is it like so? In below example why java doesn't let Line A compile without any error?
Ex :
Hi matt,

how many months did you prepare for OCP after clearing OCA exam ?
2 years ago
congratulations Igor Baiborodine!!

Did you have any Advance java knowledge or experience before ? how many weeks it would take for one to clear OCPJP ,if one has no prior java hands-on experience but has cleared OCAJP ?
2 years ago

I am a beginner . I have configured Tomcat in eclipse and trying to run http://localhost:9090 [9090 is the port I have configured] but it throws me above error.
please someone help me how to get past this error. I have no dynamic Web project. I am just trying to run the localhost and get the home page. It is working fine when I do it from a command line.
I am using eclipse oxygen and Tomcat ver 9.0

Help please
2 years ago
Hi all , do we have coderanch Hadoop cerification forum ? If yes, please provide me the link or guide me to right hadoop certification forum
2 years ago

You can login to cert view account and download your certificate from there. Once you get a link for badge through mail even e-certificate will be available.
Hi all,

I want to know about some good books/ links to learn Spring.
I am beginner and I only know core java. Any tips/advises are welcomed like where to start and how to get proficient in it.

Thanks in Advance      
3 years ago
Hello All,

I gave my OCA 8 java exam today and cleared it with 80%. Though the score is not so high, I am satisfied with it.
Firstly, I would like to thank everyone on this forum.This helped me understand a lot of topics easily.
I must say this is the best forum to learn and people here are so kind and always ready to help.

There are already so many articles in this forum which will help you learn java and clear exam.Thanks Roel for providing me many such links

I will just mention few points so it can boost the confidence of other people like me.

Background/Experience -        I had no prior experience in java and also I didn't Study java in college.
   I was an electrical student.So I  started it from scratch.

Duration                       -       I took approximately 2 or 2 1/2 months.I spent everyday 3hrs approximately.

Books                          - Certified Associate Java SE 8 Programmer I by Jeanne Boyarsky & Scott Selikoff
                                  - Mala Gupta's OCA 8 guide ( I couldn't study this completely .I referred only a few topics)
Software              - Enthuware and whizlab
Other Resources       - code ranch Forum and Oracle Doc.

Enthuware Score      - Test1 56%
                               Test2 71%
                               Test3 73%
                               Test4 74%
                               Test5 69%
                               Test6 81%
                               Test7 77%
                   Final day Test 78%.

while taking mock exams I would rush to complete the exams and would make silly mistakes by missing out the small details or not understanding the question properly and loose marks in spite of knowing that topic very well and I feel even in final exam I have done the same.
Like many were saying the real exam is little easier than enthuware. I was actually expecting above 90%  . So it is not only about how much you have learnt but how you will put that in the exam to score high.You Should be able to remember every related concept while answering(It is not difficult it will come with practice). So please give required time for each question, read it carefully so that you don't make silly mistakes and regret it later when you get to know how easy it was.For example, not differentiating between () or {},; after "for" block, variable shadowing,  [] in the main method, forgetting about this and super call, parameters in getter methods etc. Make notes for things which seem easy but also confusing. when you find similarities between topics note it down or highlight the differences so it will help in last minute preparations ex: String and String Builder methods.Such similarities and easiest things confused me a lot in the real exam.I wasn't disciplined in learning.And also, I took more time in real exam than mock exams.So  Don't make such mistakes and you should glance easiest things at least once before that exam  
All the best for all who are going to appear for this exam.For any other queries or help, This forum is always there for you. Now my next goal is OCP.
3 years ago

In the above code, I thought as x is always zero and not updated and because of the continue statement,  System.out.println(j) will never be executed .so, I answered this question as "the code doesn't compile" but I was wrong.
May be is this because compiler thinks after line A there are chances of updating "x"?
what are the tips/tricks is to easily identify unreachable code?

P.S: Only zero is passed as an argument to the method in above code.

In the above code, I get error saying unhandled constructors . can someone explain how it works and what can be done so that error disappear
Congratulations Lilou   I have my exam scheduled this weekend. My Enthuware average is 70%  
I have a deadline to clear this exam soon. what are my chances of clearing the exam considering my enthuware score ?
I believed it would be lot easier than enthware but now worried
I read  

The default package is automatically imported in the java classes and interface defined within the same directory.


Members of named package can't access classes and interface defined in the default package regardless of whether they are defined in same directory or not.

In the image attached, I see the error in Test2  example file saying the type is already defined. while using the command line as I mention the path I did not find any difficulties there.
isn't Test2 different directory? quote 1 says there are imported only within the same directory.

I am not getting how IDE works or may be I am not understanding how default package works.Please help me with this concept.  

3 years ago

The Answer says code throws StackOverflow error and code never reach 7 or 8. I did not understand the explanation given there.
where and how is the recursiveness happening here?

There is no recursive call in above code right?

The answer to 10th question ( Garbage Collection ) of Assessment Test is  given  below

C, D, F. Immediately after line 9, only Grasshopper g1 is eligible for garbage collection
since both one and two points to Grasshopper g2. Immediately after line 10, we still
only have Grasshopper g1 eligible for garbage collection. Reference one points to g1
and reference two is null. Immediately after line 11, both Grasshopper objects are eligible
for garbage collection since both one and two points to null. The code does compile.
Although it is traditional to declare instance variables early in the class, you don’t
have to. For more information, see Chapter 1.

I believe it should be  Reference one point to g2 and not g1.
@Stephan Thanks. But Pardon me for repeatedly asking the same thing as I am Java Beginner and I am not getting it. I will put my confusion here as cases.

Case 1 :Static Context

In the code above, when the class is loaded for the first time, which line is run first? Is it line 6 or line 3 ( I get this doubt when I try the same code with instance block which I will mention below)
Just say, If it is line 6, then as you have mentioned earlier it should have had default values and print 0 on line 4. so I  didn't get what you meant

the variables will first be initialized to their default values, which is 0 for ints. After that, explicit initializers (both initializer blocks and field initializer statements) will be run in the order they are encountered.

Case 2: Instance Context

Here, The output is 0 6. I encounter the same error mentioned in static context if this.x is replaced by x. I want to know how this.x prevent throwing an error and Please let me know between 3 and 6 which line runs first in both the context.

Thanks in Advance