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

Benjamin Ng

Greenhorn
+ Follow
since Jul 12, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Benjamin Ng

Himai Minh wrote:Congrats Benjamin.
By the way, on PearsonVue , did you click on the yellow button "Continue Exam" to submit the assignment?

So, after I submit the assignment, should I sign up for the essay right away? Or, wait until I know if I pass the assignment ?



Thanks Himai Minh!

Like Roel De Nijs mention, you have to submit the assignment first before you can allow to try to sign up the essay. For me, i took my essay exam on the next day i submit my assignment.
5 years ago

Himai Minh wrote:

Benjamin Ng wrote:Congrats Margarita!

I also just upload and taken my essay on 19 Oct 2012. Can i check with you how do you check the assignment result from pearson vue? currently both the assignment and essay's status is set as taken.



Hi, Benjamin.
Did you get a email confirmation that your jar file was received?
Did you sign up for the essay? Why does your essay's status is set as taken?

On PearsonVue, to submit the jar file, should I click the yellow button "Continue exam" and then submit it?
I will submit mine later.



Hi there,

So far i did not received any email from pearson vue but now when i go in and click the score report link, it says i pass.
5 years ago
Congrats Margarita!

I also just upload and taken my essay on 19 Oct 2012. Can i check with you how do you check the assignment result from pearson vue? currently both the assignment and essay's status is set as taken.
5 years ago

Himai Minh wrote:Hi Benjamin buddy,
Agree. This is confusing.
You may want to assume "" is a value. For example, name is "".
If the name criteria is "", search for names "".
If the name criteria is null, return all records with any name.

Agree with this ?



Yes i agreed.

Himai Minh wrote:

Benjamin Ng wrote:

Himai Minh wrote:0 records.
Because all records have their names and cities. Their names and cities are not "".



how about i pass in a String array of {null,null,"","","",""}, is the expected result still 0?



The expected result is all records. K Tsang buddy said null indicates a wildcard. The first "null" indicates all records with any name. The second null indicates all records with any city.

If you have a string array of {null, "New York", null, null, null, null}. The expected result is any name in New York city.



Sorry i am getting confused. Let me clarify something, based on my understanding, if i send a String array of {null,null,"","","",""}, shouldn't the expected result is 0 because even though both name and location are using null, but the rest of the search is not using wildcard so the check should be something like <is the rate begins with "">, <is the size begins with "">, <is the owner begins with ""> which for these cases they are not begin with "" so the final results is return 0 records?

Himai Minh wrote:0 records.
Because all records have their names and cities. Their names and cities are not "".



how about i pass in a String array of {null,null,"","","",""}, is the expected result still 0?
thanks for the reply everyone. Now i doing junit testing on the find method for the Data.java and i need some clarification. If my criteria array is all empty value which means is {"","","","","",""}, what should the expected result for the find method? 0 records or all valid record in the database?
thanks for the reply.

Roel De Nijs wrote:Like K. Tsang indicated my choices.txt is structured like the marking scheme. In my choices.txt I mentioned a lot of implementation details (like class names, method names, instance members,...) and of course this kind of information I also mentioned during the essay exam. But I didn't mention why a screen was designed the way it was or why I used such a package structure. So from your list: I only did number 2, numbers 1, 3 & 4 I didn't mention in choices.txt



does that mean you structure your choices.txt into:

1) General Considerations
2) Documentation
3) Object-Oriented Design
4) GUI
5) Locking
6) Language Fluency

but will there anything to write for Documentation and language?
hi everyone,

I would like to check whether do you indicate the following details in the choices.txt:

1) why is the main application window is design in this way?
2) what is the purpose of a particular class
3) why is the launch application window is design in this way?
4) why the package is split in this manner?

Roberto Perillo wrote:I'd say option A is cleaner.

But... is this question of yours related to the OCMJD certification? Are you going to use something like this in your solution?



Hi Roberto,

Yes is related to OCMJD certification. i wanted to use something like option A in my solution for displaying text in GUI but not sure whether is good convention.
hi,

i have decided to use resourcebundle to retrieve text from properties file and display on GUI. However there is some similar text that will be used throughout a class so for such scenario what is the best convention to handle? option A or B?

// option A
public static final String TITLE = GuiResources.getString("title");

public void Book()
{
displayDialog(TITLE, "please enter");
//more coding for booking
displayDialog(TITLE, "success booking");
}

//option B

public void Book()
{
displayDialog(GuiResources.getString("title"), "please enter");
//more coding for booking
displayDialog(GuiResources.getString("title"), "success booking");
}
Hi people,

sorry i have a question which might be stupid but i want to clarify something. For my DB interface i have the following statement:

// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public int[] find(String[] criteria);

does a null value in can be null or "" or it only refers to null?

Roel De Nijs wrote:If my application starts a dialog is shown where user can enter the configuration details as needed. When everything is fine, these details are saved into a file suncertify.properties (in the current working directory). When the user starts the application again, the dialog is shown again and the configuration details are loaded from the suncertify.properties file (which the user can change or just leave them as-is). So the configuration information is persistent between runs.



sorry to interrupt but i like to check should the configuration be persisted between two different mode run.

For example, firstly i run standalone mode and indicate my db path. The db path is save successfully into the properties file if everything is fine. I close the window. Next i run the network server mode. should
the db path i previously type in standalone mode to be show or should be empty since this is my first time running network server mode?