Nam Ha Minh

Ranch Hand
+ Follow
since Oct 31, 2011
Nam likes ...
Hibernate Eclipse IDE Java
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
42
Received in last 30 days
0
Total given
3
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nam Ha Minh

Basically, this refers to the current instance (this instance) of the enclosing class. So whenever you need to access the current instance explicitly you need to use this.
Besides using this in setter methods, I also use it to call overloaded constructors, for example:



You can learn more about this keyword in Java here
4 years ago
Could you give some examples which Lambda expressions should be used on non-functional interfaces?
4 years ago
I think you use a collection (typically List) to store bikes rented by a customer.
Then returning a bike to the store is simply removing that bike from the collection.
4 years ago
Continue...
OrderDetail.java:



OrderDetailId.java:



I hope this helps. I made that code based on these tutorials:

  • Hibernate Many-to-Many Association Annotations Example
    Hibernate Many-to-Many Association with Extra Columns in Join Table Example

  • I did the same, and this is the working version on my side. For your reference (I remove unrelated code such as some unrelated fields, constructors, equals, hashcode... for the brevity):

    Book.java:



    BookOrder.java:

    Hi, if you don't know where to start, I recommend you to read "Head First Java" - this is a really good book for beginners. Just by completing reading of this book, answer all its quizzes and do all its exercises  you will have a very good start in Java programming.
    4 years ago

    Ankit Minglani wrote:Hi All,

    Happy to let you know that I have passed OCAJP8 - Programmer I - 1Z0-808 with 95% score. I have shared my preparation and experience for certification on my personal blog:

    https://almostcurious.wordpress.com/2017/06/17/oracle-java-programmer-i-1z0-808-certification-with-95-score/

    Would like to thank people in this community for keeping the culture of helping each other. It is really great for newcomers trying to take these certification exams or otherwise.

    Thanks



    CONGRATULATIONS! Great Score!
    6 years ago

    shambhavi ss wrote:alright thanks all , got it !      

    i have another question !


    in the above code, in line 3, if i do not declare the exception or if i do not handle it inside main(), i have a compiler error.

    when the eatCarrot()  method has declared the exception then why should the main() again do it ?? if eatCarrot() method definition throws an exception, it'll be thrown as declared by its respective 'throws' clause in its signature, right ? why should we again declare the exception in main() i.e. in the caller of eatCarrot() ?



    It's because when you call a method that throws an exception, the calling code must either handle it (by using try/catch structure), or re-throw it to the upper caller, i.e. throws in main() method in your case.
    google "IBM UML class diagram". I remember IBM's website contains some quality articles about UML, which relate to their UML software Rational Rose
    6 years ago
    Welcome Chris Coyier. You're more than welcomed
    Congratulations, you rock!
    And thanks for the String notes.
    7 years ago
    Congratulations, you rock!
    Can you tell me what books do you read?
    7 years ago
    Yeah, you should use SMTP settings of GMail instead.
    7 years ago
    Just look at Oracle site here:

    https://education.oracle.com/pls/web_prod-plq-dad/ou_product_category.getPage?p_cat_id=266

    There's no longer available of any courses or certifications for Java ME.

    Does that mean Oracle discontinue it?