Win a copy of Head First Android this week in the Android forum!

Alex Derek

Ranch Hand
+ Follow
since Apr 10, 2013
Alex likes ...
Mac OS X Safari Windows
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alex Derek

Thank you again Jeanne,

I'm going to study well the topic. :-)

When you write "file based approach" you mean something like a simple .txt file were the data are stored? However in this case I should create some kind of encryption just to try to hide the data.

The encryption problem is something that actually intrigues me. (e.g. If on a computer there is a keylogger... ).

However thank you again for the suggestions I'll think about it, and start with the simpler version
David, I have a degree but not in technical stuff. After doing various jobs, I decided to pick up again my passion for programming (seen also that in this moment find a job in Italy is pretty tough) and I started studying java.
In the meanwhile I have sent a lot of c.v. in the area where I live there are a lot of requests for java programmers.
I never had a reply.

Different reasons.
1 - Mainly people who hires wants at least 1 year of previous experience.
2 - They want you to know different frameworks (struts, spring) or j2ee or web technologies (javascript, html5, css etc. etc.), that I don't know yet.
3 - They prefer a person with a CS degree.
4 - other reasons...

Given all that, I am still studying considering that:

1 - I am aware that all this could be a loss of time (in the meanwhile I'm sending c.v. also for other jobs like barman or whatever)
2 - I am trying to expand my knowledge - After passing OCA 5/6 and OCA 7, I am now preparing OCP 7 and studying sql and trying to start with android
3 - I think that one of the best possible solution for this problem is to create more than one program and publish them on a website and refer to it in a c.v.
so that you present yourself and your competencies, the most complex are the programs, the best, obviously.
4 - Maybe I have a brilliant idea for a wonderful app and I become the employer of myself :-)

So, you are not alone! Don't give up and good luck to us!
Hello Jeanne, and thank you very much for your reply!

1) Ok, I've not understood really well the explanation on storing password. Could you suggest me some books or web resources were I can study the problem? (I don't want to bother you too much :-) ).

2) I was thinking to start this little program as you suggest, as a standalone program with a local db, mainly to practice with sql and JDBC (I'm going to prepare ocp 7).

3) What I need from a program like this is the possibility to work in every kind of 'ambient' I come across. I mean, I have subscribed more than 80 sites, forum etc.. I work mainly with my computer, but sometimes I work from other computers, I use my phone etc. etc. But, if I need a login and password for a specific site either I remember my credentials or I write donw on a paper all login and pwd and use that. Program with similar functionalities (I'm using LastPass) are local to the computer you are using (last pass is a plugin for the browser, other programs are stand alone solutions). So I was asking myself if it wasn't possible to have a 'cloud' solution, something that is available every where.

Again, thank you for your attention

Could I ask you some suggestions in preparing this certification? Like, which books, sites, mock exams etc.
I'm going to prepare this one... :-)
8 years ago

I'm going to prepare for this one too... :-)
8 years ago
Hello everybody,

I hope to be in the right section.

I'd like to have a suggestion about how to proceed to make an application I have on my mind.

The purpose of the program is to keep ID and password of the site, forum etc. a user has subscribed and,
clicking on a link or button, be redirected to the page with the data already filled (still better, directly logged in).
(I know there are a lot of them around, but i don't like them).
My ultimate goal is to make the program platform and device independent.
Obviously to be device independent I think that the program should run on a server and the interface probably on the web.
I'm thinking that with a servlet, JDBC and an SQL database I could solve the problem.

1) are the planning right? Did I forget some really important (or not) passage?
2) in case I see that is the program of the year, and I decide that it's a good product a lot of people are eager to use, :-)
I should worry about security. Using SSL is enough for the security of a program like this? I have heard that similar
program use encrypted keys etc. I know really little about encryption, on the web there is the need of specific encryption too, or
SSL is enough?
3) However I would like to start doing this program only in java running on client side, is it feasible? I mean, I don't know if Java can
check which browser is installed on the computer, run it, load the login page of the site and
fill the textarea (or whatever) for ID and password (the user has just to press enter...)I'm not asking for precooked code, just a
yes or no, and, if yes, which api I should study?
4) does it make sense to create a program like this one? Or is it just a time-losing activity? Does it make sense to use java? Or this is a task for a different language?

Thank you
Congratulations Emma and Sergey!!

I'm also proud to say that I have passed the exam a couple of day ago with 93%

Having prepared on Mala Gupta book and with Enthuware software, my deepest thanks goes to them.

A big thank also to all the community of JavaRanch for the incredible quantity of informations available and the kindness of all the people!
8 years ago
Hello Mohammad,
i've not tried the trial version of Enthuware, but directly bought it. I already used Enthuware for OCA SE5-6 and it's been incredibly useful.
As you said in the beginning, author Mala Gupta writes that it's good to take ten or more mock exams. Enthuware gives you 6. Mala's book (or another one) gives you one, so you are 7.
I was thinking to purchase another set from whizlabs, also if it's more expensive than Enthuware....
whizlabs link
it gives you 4 more exams, so you go to 11. And i think that at that point you should be pretty sure to pass the exam.
(i prefer to spend some more with material study, than to pay two time the exam...).

Else there are also this resources, given by enthuware forum, but i've not yet seen to them.
Enthuware links for free mock exams
Consider that the aforementioned Enthuware link refers to the sun version of this certification.

Dear Matthew,
thank you for your kind reply.

In fact your intuition has brought something interesting, also if not the solution.
I'll explain.

I've changed GeneralMethods as you suggested. But the error was there. So i've put
a println in the constructor, run the program, and it prints the value of firstInput!
So firstInput cannot be null. So i looked with more attention to the nullpointer indications.
Here is the modified GeneralMethods class:
i've inserted also line 06 and 07 to check the value of firstInput:

iMac-di-Alex:class Sarjo$ java cam.pippo.ExerciseWithString
Please insert a word, any character allowed asefse <-- word inserted by me through command line.
asefse <-- this is the first println in the GeneralMethods Constructor line 4
e <-- this is the variable be (line 6 and 7).
Exception in thread "main" java.lang.NullPointerException
at cam.pippo.Parameters.setFirstCharParameter(
at cam.pippo.Parameters.getFirstCharParameter(
at cam.pippo.methodIndexOf.IndexOfVariants.<init>(
at cam.pippo.ExerciseWithString.go(
at cam.pippo.ExerciseWithString.main(

At this point, i suppose that the problem is in the class Parameters.
I'm going to post an excerpt.

to me the class looks ok. Maybe fresh eyes can see what it's hidden to me...
However, just to be thorough, i've tried to substitute the line
in class IndexOfVariants using the variable char be in the constructor GeneralMethods
so the line :

it's become:

The nullpointer ex is still there, but it changes the line of code that calls it.

Exception in thread "main" java.lang.NullPointerException
at cam.pippo.methodIndexOf.ChooseIndexOfParameters.<init>(
at cam.pippo.methodIndexOf.IndexOfVariants.<init>(
at cam.pippo.ExerciseWithString.go(
at cam.pippo.ExerciseWithString.main(

this is the line (21) that gets me the error in class ChooseIndexOfParameters
here there is only the constructor (the error is called at line 4):

Ok, that's all.
Sorry for the longness but i think it's the only way to be clear.
8 years ago
Ok, after long and troubled meditation, hope someone can help me.

Here is the workflow of the version that works.

This is the starting class (with main)(excerpt)

This is the base class (IndexOfVariants is the child class). It's a simplified version.

Then there is IndexOfVariants which does the work.
In this way, everything is all right.

I wanted to change things. In this version the creation of UserInput and firstInput
are made in the working class. I added a constructor to GeneralMethods and
passed the value of firstInput in the constructor.
working class(with main) (excerpt)

In GeneralMethods the value of firstInput "in my calculations" should be passed to Parameters listOfParam.
GeneralMethods class (base class of IndexOfVariants):

But i get the nullpointer ex. I've understood that the problem is firstInput in GeneralMethods.
If i give a value to it, i dont get the error anymore. But i thought that modifing the value
through the constructor of GeneralMethods the value of firstInput should be updated. But
it's not so.

What i don't understand is why firstInput doesn't take the value inserted in command line?
I mean in the first example, it's all right, it works. But in the second example it doesn't.
What's the difference?
For what i have understood about inheriting and OOP, it should be the same... but it's not!
8 years ago
Dear Winston and Jesper, thank you for your kind reply.

@Winston you are right (the code IS wrong) but it's ironically funny to presume to have done things right, when
you know it's not so.

8 years ago
Thank you for your reply, Ivan.
I run the program from command line, so it already tells me where the exception is thrown.
And it's thrown by firstInput.
My point is that i don't understand why.
firstInput is initialized the moment the user insert some text. And the exception is thrown
exactly after the user insert a word.
8 years ago

i have a problem with the program i'm writing.
This program is done to help memorize how String methods work. Basically, from command line,
it asks the user to insert a word and then it asks the result of a method (for instance indexOf) on
the word inserted.

So in the program I have an abstract class

Then i have two different derived class. I thought that having declared and initialized firstInput
in the abstract class, the value of firstInput would be fixed.
BUT when i call the second derived class, i have to insert again a word.

So i thought that maybe if i moved the firstInput creation (the line of code written above) in the
working class, and then create two instance of the derived class and passing the value of
firstInput as parameter of their constructor i'd solve the problem. But, i get the nullpointer ex.
To be precise: the program compile, run and asks to insert a word. After i insert it, it crash
because the nullpointer.
What i don't understand is that in theory, if i'm not wrong, it should work. The value of
firstInput is not null as soon as i write it in command line, right? Why it goes as nullpointer?

Any suggestions?
8 years ago

i'll try to help you. :-) (i'm also preparing this exam).

On line 04, anotherMethod(ejg), prints 20, because, inside the method on line 18 there is a System.out.println(val).
When you call the method, you pass the variable ejg as parameter of the method, and so val has the value of ejg, 10.
This value get changed to 20 on the first line of the method (line 17).
Then the method prints this value on line 18. Then compiler go back to line 05 and prints the value of ejg, which has not
been changed and it's still 10.

Same thing for line 07 and 08.

good luck for the exam!