Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Vishwanath Krishnamurthi

Ranch Hand
+ Follow
since Jun 04, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
8
Received in last 30 days
0
Total given
10
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vishwanath Krishnamurthi

I just looked it up. Looks with a MEAP subscription to a book, the reader would get to read the chapters as and when written by the author.
And once the whole book is completed, the subscriber receives the final copy.

What's interesting is to hear about the forums and how the reader could discuss with or post feedback to the author during the process.

Yay ! Being more involved than just "reading" - I'd like that

-Vishwa
SCWCD concentrates on the fundamentals of web-development. Servlets, JSPs, Filters etc..

But in real world, these alone won't be enough. And you'd most certainly be using a web-framework. So my recommendation would be to try out a project using a web-framework.
Spring-MVC is a popular choice on that. If you were looking for ideas on what a project could be on, some sort of e-commerce application would be a good start. Like a mini amazon.com
Congrats ! Have fun learning EJB !
To add to what Mohamed Sanaulla explained,

these are the things to remember-


  • Runtime polymorphism applies only to methods. Or in other words 'Dynamic method dispatch' is supported. (Finding the type of object at runtime and invoking the corresponding method)
  • In the case of variables, its always the 'reference type'. There's no such thing as 'Runtime Variable Dispatch'.. Everything is resolved at compile-time when it comes to variables


  • Now to shadowing:

    What happens, if you have a variable by the same name in the superclass and the subclass and what if they were initialized with different values ?

    Well, its all about the reference type with which the variable is accessed. If accessed with a reference of the superclass, you get the value you initialized with in the superclass
    If accessed with a reference of the subclass, you get the value you intialized with in the subclass. The actual type of the object doesn't matter (Whichever subclass object be assigned to the reference). Only the reference type matters.

    As to the word 'shadow'ing

    To say that gearRatio is shadowed in SportsCar, it means that the superclass's value is bypassed and the new value defined in the SportsCar is used. The word 'overriding' is avoided here as 'overriding' is a term that is tightly used along with 'runtime polymorphism'. And that isn't the case here

    -Vishwa

    Rahul Sudip Bose wrote:
    1.The web.txt file is blank


    Try flushing the printWriter:



    Rahul Sudip Bose wrote:
    I have a doubt, can i make a .xml file and write text to it OR, do i have to make a .txt file - write the text - and then rename it to .xml ?


    Yes, You can create an xml file and write to it.

    And one more thing, don't forget to close the PrintWriter
    6 years ago
    What have you tried so far ?
    6 years ago



    whereas,


    i.e in "=+" is not a single Java operator. You should read it as assignment of a positive number.

    like how

    int a=-5; would mean assigning a negtive number
    6 years ago
    Hi John,

    Overriding is only for methods. Not for instance fields.

    PS: You might find it easier to paste the code and use code tags, than to post screenshots
    6 years ago

    Tim Hoang wrote:the code should stop after it hits the else



    Then introduce a break statement like this:



    Vishwa
    6 years ago
    Hi Jayesh,

    You should get true if you did

    System.out.println(s1.equals(s2));

    Check how equals method differs from ==

    Vishwa
    6 years ago
    Hi Jenna,
    Green UML is neat eclipse plugin. One other choice would be Architexa
    Apart from reverse engineering to get class or sequence diagrams, also consider writing unit / functional tests. It helps to understand a project faster

    Vishwa
    6 years ago
    Sorry, I don't understand your question clearly. Typically you'd iterate through the recordset, create one DTO object corresponding to one row retrieved, and add that DTO to the ArrayList.
    So If you have 100 rows retrieved by a query, then you'd have an ArrayList that contains 100 DTOs.

    HTH,
    Vishwa
    6 years ago
    Can you copy the c.tld file, place it in /META-INF and check ? to see if this URI is then found, or you are thrown a different error ?



    6 years ago
    JSP
    Can you double-check the URI at the tld file in your JAR.. that it is indeed using

    http://java.sun.com/jsp/jstl/core

    and not

    http://java.sun.com/jstl/core ?

    6 years ago
    JSP