• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

“Overloading Methods” topic, chapter 4 (Java OCA 8 Programmer I Study Guide)

 
Mushfiq Mammadov
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. On page 191, “Overloading Methods” topic, first and second sentence
Maybe I understand wrongly for my English, but I guess first and second sentence are opposite each other. In first sentence is written “same signature”, but in second sentence is “different method signatures”. Maybe in first sentence “same signature” should be “same name”.

2. On page 194, space ( “ ” ) is missing
There should be space at the end of both example outputs. In the second paragraph “string object” should be “string object ”. In the second paragraph of “Primitives” section “int long” should be “int long ” and “long long” should be “long long ”.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mushfiq Mammadov wrote:1. On page 191, “Overloading Methods” topic, first and second sentence


I agree with you! "with the same signature in the same class" should be "with the same name in the same class". Overloaded methods must have the same name and different type parameters => different method signatures (the method signature = the method's name and the parameter types). If you would declare 2 methods in the same class with the same signature (as in the 1st sentence), you'll get a compiler error (duplicate method).

Mushfiq Mammadov wrote:2. On page 194, space ( “ ” ) is missing


Spot-on! If you like to nitpick (I really love it, I illustrate in a few moments ), all example outputs on this page should indeed end with a space (“string object ”, “int long ” and “long long ”).

Now I'm gonna prove I love nitpicking: there's an inconsistency between how the outputs are represented: the first one uses double quotes, no double quotes for the 2nd and 3rd output. Using double quotes for all of them would probably give the most clear representation of the additional space at the end (although that's completely not relevant in these code snippets).

Hope it helps!
Kind regards,
Roel
 
Mushfiq Mammadov
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote: Spot-on! If you like to nitpick (I really love it, I illustrate in a few moments ), all example outputs on this page should indeed end with a space (“string object ”, “int long ” and “long long ”).

Now I'm gonna prove I love nitpicking: there's an inconsistency between how the outputs are represented: the first one uses double quotes, no double quotes for the 2nd and 3rd output. Using double quotes for all of them would probably give the most clear representation of the additional space at the end (although that's completely not relevant in these code snippets).


I like to read something with all small details if that thing is more important for me. I almost write and run all example codes in IDE which exist in this book, it helps a lot for learning. Therefore I see minor typo. The last time I find redundant typo -
on page 171, "Optional Exception List" section, the last line of example, closed curly brace is a big font than opened - but I don't note it. I try to note typos here which I come across, maybe it help to authors for the next edition of this book.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mushfiq Mammadov wrote:I almost write and run all example codes in IDE which exist in this book, it helps a lot for learning.


Any reason why you use an IDE to write/run example codes and not your favourite text editor in combination with javac/java?
 
Mushfiq Mammadov
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote: Any reason why you use an IDE to write/run example codes and not your favourite text editor in combination with javac/java?


When I read chapter 1 I used text editor (Notepad++) for learning javac/java. But IDE (Netbeans) is more comfortable than text editor for me. I am not in the habit of writing in text editor, it gets more time for me. But I save my time using IDE, in any time I make minor changes to test this code is compiled or not or so on. But with text editor I must call javac/java every time if I change the code.
I saw in some old posts you advise to use text editor. I would like to advise from you about this. What is disadvantage to use IDE and what is advantage to use text editor?
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mushfiq Mammadov wrote:But IDE (Netbeans) is more comfortable than text editor for me. I am not in the habit of writing in text editor, it gets more time for me. But I save my time using IDE, in any time I make minor changes to test this code is compiled or not or so on. But with text editor I must call javac/java every time if I change the code.


I'm fully aware of that. It's much harder (as in takes more time) to write a code snippet using text editor than an IDE, certainly if you make little typos. Simply because the IDE spots the compiler errors for you and automatically compiles if your code is valid. But on the actual exam you don't have an IDE at your disposal and you have to spot the compiler errors yourself without the help of an IDE.
And I think you'll learn (and memorize) much faster from your mistakes because it takes you more time to compile/run your program. Because you don't want to go through the complete hassle of compiling, fixing the errors/typos, compile again, fix a new error/typo, compile once more and finally run the program. But that's just my opinion, it's not scientifically proven. But on the OcajpWallOfFame you can read sometimes the experiences about switching from an IDE to a text editor (e.g. here).

Mushfiq Mammadov wrote:I saw in some old posts you advise to use text editor.


Although these posts may be old, it's still my prevailing (current) advice

Mushfiq Mammadov wrote:I would like to advise from you about this. What is disadvantage to use IDE and what is advantage to use text editor?


In this thread you'll find some different opinions (including mine) about using an IDE or not.
 
Mushfiq Mammadov
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:I'm fully aware of that. It's much harder (as in takes more time) to write a code snippet using text editor than an IDE, certainly if you make little typos. Simply because the IDE spots the compiler errors for you and automatically compiles if your code is valid. But on the actual exam you don't have an IDE at your disposal and you have to spot the compiler errors yourself without the help of an IDE.
And I think you'll learn (and memorize) much faster from your mistakes because it takes you more time to compile/run your program. Because you don't want to go through the complete hassle of compiling, fixing the errors/typos, compile again, fix a new error/typo, compile once more and finally run the program. But that's just my opinion, it's not scientifically proven. But on the OcajpWallOfFame you can read sometimes the experiences about switching from an IDE to a text editor (e.g. here).

Mushfiq Mammadov wrote:I saw in some old posts you advise to use text editor.


Although these posts may be old, it's still my prevailing (current) advice

Mushfiq Mammadov wrote:I would like to advise from you about this. What is disadvantage to use IDE and what is advantage to use text editor?


In this thread you'll find some different opinions (including mine) about using an IDE or not.



Thanks a lot for your valuable opinion, Roel. I read all posts attentively which you linked. And I admit that your post changed my opinions about text editor, especially the following part:

Daniel Clinton wrote:
In the middle of my preparation, when I first started attempting timed exam questions,
I wondered if I could ever pass the test at all. Time per question was of such great concern to me.
Then I posted here and took this advice: Use just a text-editor with javac
I reckon it's the only way to go for this particular exam
It WAS a little tricky at first but accuracy and speed shot up after a week.
For sure it reduces code figuring-out time and makes compilation error spotting quicker.



Roel De Nijs wrote:
Back in the days when I studied Java at college, I had to use Notepad, javac and java for the simple reason my old computer wasn't able to run any of the available IDEs In the beginning I struggled and I made not much progress. But once I had mastered, my Java knowledge improved faster than my classmates. I was even able to assist them to pinpoint the cause of compiler errors they encountered using an IDE. My knowledge of the Java API was also significantly better. And the reason is fairly simple: when you make a mistake using a text editor, you are punished harder than someone using an IDE. You need to adjust your code, compile it again and run it. With an IDE it's all done for you and you don't have to switch between different windows. It's almost some form of conditioning So you learn very quickly you need anArray.length and aString.length() to get the length of respectively an array and a String.



I have a problem with time per question, it takes me more time too. I know it is a bit hard to use text editor for me, but I will try

P.S. It is interesting that in OcajpWallOfFame I haven't seen anybody who get OCA8 yet.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mushfiq Mammadov wrote:I have a problem with time per question, it takes me more time too. I know it is a bit hard to use text editor for me, but I will try


At first it will be a bit harder and you'll probably have a few moments but after a while you'll have mastered it and you'll quickly notice the advantages. Good luck!

Mushfiq Mammadov wrote:P.S. It is interesting that in OcajpWallOfFame I haven't seen anybody who get OCA8 yet.


True! And after a little adjustment, that page is 100% ready to welcome the 1st name on the OCA8 wall
 
Jeanne Boyarsky
author & internet detective
Posts: 41763
887
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mushfiq,
Agreed. Added both to the errata. There's a problem with using spaces at the end of the output. Quotes would have helped. If I was doing the example again, I'd have put a dash there instead of a space so I wouldn't have to deal with an "invisible" character.

I do appreciate these little things. It's great to have such attentive readers. Like Roel, I'm in the "don't use an IDE" camp. However, this is a controversial topic. One that Scott and I disagree on in fact. You can read his pro-IDE post here. That said, I think the reason for not using an IDE doesn't apply to you. You are clearly extremely detail oriented and aware of what the IDE is doing for you.
 
Jeanne Boyarsky
author & internet detective
Posts: 41763
887
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:

Mushfiq Mammadov wrote:P.S. It is interesting that in OcajpWallOfFame I haven't seen anybody who get OCA8 yet.


True! And after a little adjustment, that page is 100% ready to welcome the 1st name on the OCA8 wall


Just stole that spot. I feel like it's more inviting to not have a blank list.
 
Mushfiq Mammadov
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote: At first it will be a bit harder and you'll probably have a few moments but after a while you'll have mastered it and you'll quickly notice the advantages. Good luck!


There is no success without trouble. Thanks a lot

Jeanne Boyarsky wrote:I do appreciate these little things. It's great to have such attentive readers. Like Roel, I'm in the "don't use an IDE" camp. However, this is a controversial topic. One that Scott and I disagree on in fact. You can read his pro-IDE post here. That said, I think the reason for not using an IDE doesn't apply to you. You are clearly extremely detail oriented and aware of what the IDE is doing for you.


Hi, Jeanne. In the above post Roel referred to this link and I read Scott, Paul, Roel and your opinions. It is a very useful topic and changed my opinions. I am reading Lambda Expressions from your book now and I have already tested to write codes in text editor once. Thanks a lot
 
What's that smell? I think this tiny ad may have stepped in something.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic