Jude Niroshan

Ranch Hand
+ Follow
since Nov 18, 2014
Jude likes ...
Eclipse IDE Java Postgres Database
I have cleared out Oracle Certified Associate(OCA) and Oracle Certified Professional(OCP) in Java SE 8. I'm a friendly user. I am not afraid to be failed.
Cows and Likes
Cows
Total received
5
In last 30 days
0
Total given
0
Likes
Total received
16
Received in last 30 days
0
Total given
185
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jude Niroshan

Campbell Ritchie's answer is correct. I'll explain a bit if you still didn't understand.



In the above line, it means, you created an Array which can hold 3 Books. That's all what this line means.

But you assume, the array do actually have 3 Books when you write that above line. This is wrong!

So, you must fill that empty myBooks array with Books objects
2 months ago
Welcome to Coderanch!  

I would happy to see where do you define the variable

Please note that when you are writing quality code, you should always follow the coding standards. In Java you should always start a variable with a lowercase letter and follow the camelCase style when you are giving names to variables and methods. I hope you will provide the Path variable definition and where it is done.
2 months ago
I think what you should do is, you should try to build a project with what you know. Then think whether were you lacking some knowledge which was essential and you couldn't really understood. Then take a while to think whether you are going to take a certification or just Googled it and learn by applying those.
As Roel said, put it as Oracle Certified Associate, Java SE 8 Programmer . That sounds associate as well as Programmer.  
Howdy everyone,

I was playing around with new Java 8 streams API, when I caught up with this compilation error. (I'm using IntelliJ IDEA)

Below is my Student.java



Here is my method method class:



This is the compilation error that I received,

Error:(36, 66) java: incompatible types: inference variable R has incompatible bounds
   equality constraints: java.util.Map<java.lang.String,java.util.List<org.chapter3.Student>>
   upper bounds: java.util.Map<java.lang.String,java.util.List<? super org.chapter3.Student>>,java.lang.Object



Thanks & Regards,
Jude
Hi Theo,

Appreciate your reply.  I understood how the parallel reductions happens. You have pointed some important facts about reduce().

reduce() has 3 versions. But the most complicated one is 3 argument version which accept:

  • Identity U
  • accumulator BiFunction<U, ? super T, U>
  • combiner BinaryOperator<U>

  • Most important fact that I learnt was, even though accumulators may run in parallel, combiners will always run sequentially which they were appeared to be in the List.
    Indeed an interactive environment. You gotta check it out.

    Go to https://sybextestbanks.wiley.com/ and select the OCP book. Then you will get a prompt to register. When you click next you will be asked a random question from the book. Once you done with it, you will receive an unique ID  to the given email address. By using that ID, you can simply login to that and enjoy!

    Hope this helps!
    Hi,

    I have the paper book version of Oracle Certified Professional Java SE 8 Programmer II Study Guide. The book says it includes a access for an interactive learning environment. But in order to access those content I have to enter a unique PIN. I couldn't find anywhere in this book.

    Where is that unique PIN appears in the paper book?

    Regards,
    Jude
    Hi Jeanne,

    Always I'm pleased to see your responses. I have just bought it (directly from PearsonVue). Actually I was able to have the discount. It costs only $97.50. Thanks alot

    Regards,
    Jude
    I have a doubt whether this 35% discount is only offered for upgrade exams. But I don't have any certifications other than OCAJP Java 8. Here is a screenshot of those confused items when I go to buy voucher in Oracle university.



    Does regular OCPJP Java 8 doesn't have any discount applicable? Should I need to buy the second one shown in the image?
    Dear Ranchers,

    I am going to schedule my OCP Java 8 exam. (1Z0-809) I saw that in oracle official website, they are having a promotion for many certification exams up-to 35% off including the exam that I am going to take. I actually did this when I was doing my OCA java 8. But I'm sorry to ask this again, cos it's bit confusing and I have forgot how this process works.

    What I need to know is how to get this promotion? I have tried to book the exam through PearsonVue website (after logging into my account). Actually, I couldn't find anywhere that they mention about promotion codes or something like that. I went up to scheduling the exam on a date in their wizard (in PearsonVue), but there were nothing about the promotion. Can anyone who had done it in recently or anyone who knows how this works, can you please reply to this post, mentioning the step by step that I need to follow?  

    I hope this post may be helpful in future for someone who is going to schedule an oracle exam online.

    Thanks & Regards,
    Jude
    Hi everyone,

    I am preparing for my OCP Java SE 8. So far, I have done 2 enthuware mock exams and I got failed those both. I'm kind of disparate now. (Cos I was working with Java almost 3 years now. But I couldn't pass this mock exams at least getting 65%)

    Can anyone teach me about the reduce() in case of a parallelSteam()

    Below caption is taken from Oracle docs.

    The identity value must be an identity for the accumulator function. This means that for all t, accumulator.apply(identity, t) is equal to t. The accumulator function must be an associative function.



    I can't understand what this means> "that for all t, accumulator.apply(identity, t) is equal to t."

    I don't know how the parallel streams process each element in reduce(). Can someone help me?

    Regards,
    Jude
    So, it would be something like this at the execution time

    int x = 3;

    int y = 4 * 5 / x-- {x = 3 + 1} + --x;
    int y = 20 / x-- + --x;
    int y = 20 / 4  {because post increment, we took the value as 4, but newest x = 4 - 1}+ --x;
    int y = 5 + --x {because pre-increment, x = 3 - 1};
    int y = 5 + 2;
    int y = 7;

    So if we have something like this,
    int x = 3;
    int y = x-- + x-- + x--;
    int y = 3 + {current x = 2}x-- + x--;
    int y = 3 + 2 + {new x = 1}x--;
    int y = 3 + 2 + 1;

    Howdy Ranchers!

    The very first question of the review questions section in chapter 3 says,

    You have a collection of products for sale in a database and you need to display those products. The products are not unique. Which of the following collections classes in the java.util package best suit your needs for this scenario?

    A. Arrays
    B. ArrayList
    C. HashMap
    D. HashSet
    E. LinkedList


    My answer was (B,E). But the correct answer is marked only for (B). The explanation given is not clear about why we eliminated the LinkedList from the answers.

    Explanation as follows:
    The answer needs to implement List because the scenario allows duplicates. Since you need a List, you can eliminate C, D and E immediately. HashMap is a Map and HashSet is a Set. LinkedList is both a List and a Queue.

    Yes, LinkedList can act as both a List and a Queue. So, LinkedList can be a List. It also can be a queue. Both List and Queue allow duplicates. If we are looking for a List, then why LinkedList (which is qualified as a List) is removed?