s.apend in the test, what do you think we should do?
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Hi, As mentioned earlier somewhere, there is a fill-in the blank question in the real test which manipulates the string using string.append(); As everybody knows, there is no append() method in the String class. My impression is that Tony Alicia said we should assume the String class have such a method. and that what I did during my test. Now thinking back, maybe we should not assume that the String class has append() method, instead we could say there will be a compile error therefore we should leave the fill in blank? what do you think. the question might come up again in the test just want you to give it some thought
Deepak M
Ranch Hand
Joined: Jul 10, 2000
Posts: 124
posted
0
I'm afraid u can't really do anything about this question Its definitely included to prevent you from scoring 100 % Why do u think nobody scores 100% in SCJP ??? Microsoft has quite a few qts which are on the same lines. Atleast Sun has just one such qt.
Ajith Kallambella
Sheriff
Joined: Mar 17, 2000
Posts: 5781
posted
0
peter, I beg to differ from Tony's view point here. You can be 100% certain that the test will not contain questions that are syntactically incorrect. The only exception to this are the questions where they want you to tell if a compilation error occurs, which will be one of the answers. Deepak, people have scored 100% in the SCJP tests before. Though I don't have the demographics, you should belive me here Ajith
Open Group Certified Master IT Architect.
Sun Certified Architect(SCEA).
Deepak M
Ranch Hand
Joined: Jul 10, 2000
Posts: 124
posted
0
Ajit, there IS a question in the real exam with s.append where s is a String and its a type in question where we need to type the value of s. Are we supposed to leave it blank ? What are we supposed to type in there ?
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Hi PeterH, Infact, if you try to run a program where you say s.append(), you will get compile time error("method append() not found in String class"). I am sure you can't use append method in String. So if there is any fill in the blank, I think we should write Compile Time Error. If I am wrong, please tell me. Sanjana
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18652
posted
0
But "Compile Time Error" is not the value of the string. In fact, there is no way to indicate a compile-time error in this question, even though that would be the best answer. So the best you can do is pretend that "append" was "concat" instead, and answer based on that assumption.
"I'm not back." - Bill Harding, Twister
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Hi Jim, You say that you pretend as if it is concat instead of append method & give reply accordingly. But examiner may be testing, append() belongs to which class. On what basis we should assume that it is concat() method they actually mean? Please tell me. Sanjana
Jim Yingst
Wanderer
Sheriff
Joined: Jan 30, 2000
Posts: 18652
posted
0
Usually I would advocate taking each question literally and avoiding any assumptions. The problem is that if we do that here, there is no way to indicate the correct answer, which is that a compile error occurred. I suppose we could type "Compiler Error" or "This won't compile" or "String class has no append() method" or "This question sucks" in the text field - but I seriously doubt the testmakers have made their program smart enough to take all of those as valid ansewrs, and I don't know which phrasing is the one they're looking for. At this point, it's obvious something is wrong with the question; we just try to make a guess at what the questioner really meant to say. Personally I can't think of any other changes that make sense for this question, other than replacing append() with concat() - they are pretty similar after all; I can easily imagine that someone got them confused when creating the test. (I have a harder time understanding why it's taken this long to fix the problem, but that's a separate issue.) I think this is more obvious if you see the whole question, which I can't do here. But if you make this substitution, you see that the remaining question actually makes sense, and is a good, logical question to ask based on the exam objectives. I can't think of any other solution that makes any sense to me for this question, so that's my answer. [This message has been edited by Jim Yingst (edited August 28, 2000).]
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Jim, What about leave the fill-in area, indicating that nothing will be printed, that seem to be more logical than assuming the question needs to be fixed. Peter
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Sorry, I meant leaving the input area blank.
Neha
Greenhorn
Joined: Aug 29, 2000
Posts: 1
posted
0
Is you have two strings (s & s1)....then s.append(s1).....compile time error s.concat(s1).....new string(s2..which is different from s)
Originally posted by Deepak M: Ajit, there IS a question in the real exam with s.append where s is a String and its a type in question where we need to type the value of s. Are we supposed to leave it blank ? What are we supposed to type in there ?
Vasanth Appaji
Greenhorn
Joined: Aug 22, 2000
Posts: 13
posted
0
Hi, I took my SCJP today and got the same question being discussed. I just assumed that String class has append() since the question clearly says what will String s be when printed. I took the plunge and it seems to have turned out right. So, my advise is that just assume as Jim says and forget about it. It's quite surprising how Sun has not noticed it!!!
subject: s.apend in the test, what do you think we should do?