Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!

Mikalai Zaikin

Rancher
+ Follow
since Jun 04, 2002
Cows and Likes
Cows
Total received
38
In last 30 days
0
Total given
0
Likes
Total received
173
Received in last 30 days
9
Total given
292
Given in last 30 days
7
Forums and Threads

Recent posts by Mikalai Zaikin

us Naim wrote:

So I don't need to use  create  the  Array objects., when it Comes to String objects.



More accurate will be to say -- "no need to call explicitly constructor when you use String."

The new keyword is a sign of constructor (new object creation) -- whenever you see new you can think of "new object created"

With Strings is the opposite -- in 99.9% cases you will use string literals, e.g.



Instead of



Because second syntax:
1) longer
2) will create +1 extra object on the heap memory (which will be just consuming your resources)

So, for strings use simple literals without new keyword
1 week ago
When you do like this:



You move from this

meineBuecher -> null

to

meineBuecher --> [null; null; null]

But you still have

meineBuecher[0]  -> null

So, meineBuecher[0].title will give Null Pointer Exception

You have to do



After that you have:

meineBuecher --> [Buch(title = null, author = null); null; null]

And if you try meineBuecher[0].title it will return null, but there will be no exception.
1 week ago
Because of this:



The step above created an array with 4 elements, each of the element is of type String (this info bound with array after it created and may not be changed), and each element not initialized yet (for Object types including String it will be null)

Now, the next step for initializing array element would be:



The code above -- special case for Strings where you can use string literal without keyword new.

Generic syntax for some other object type would look like this (more verbose so for string it's not used normally):



There is no class type Inseln, so your code would fail.

If you want specifically this type, the the class Inseln must be declared somewhere in classpath, and the code would be like this:



What you must remember -- array type defined at the moment of creation and may not be changed during array life.

1 week ago
You might wait for people who used both. Most people I believe use 1 of them.
I don't want to judge in favor one product or another, but you can do comparison by using Search function of this forum.
Do "enthuware" keyword search first, then "whizlabs" and you may have own opinion after that.

HTH,
MZ
Hi Teodor,

In fact the book was so well reviewed before publishing so it has no known errors up to now.  

Sidenote: I was one of the technical reviewers.  

Just kidding (about the errata, not the reviewer)

BTW, Bert and Kathy are registered users here you can send them PM.
Jack, it looks the discussion moves away from Java and maybe Linux forum is a better candidate.

Permissions in Linux is combination of "owner" and "group" and "others" flags (bits), e.g. "owner" and "group" may have write permission at the same time, one does not exclude another.

I higher recommend you to read some basic article on Linux filesystem permission, and it will become much more clear.
3 weeks ago
Your Linux admin should make a decision how implement it better.

One approach -- add all users to some group in operating system and grant file_downloader folder write group permission.

3 weeks ago

Stephan van Hulst wrote:A tiny but important correction


Thanks for the update!
3 weeks ago
After you posted some more context: even without re-declaring I see here a problem -- the e is assumed to be double primitive



It's similar to (pseudo code):


In Unix / Linux permissions can be granted to (1) user (2) group of users (3) everyone

So, this is more task for your admin how he wants to handle it.

First the admin should get user ID under which JVM (Tomcat) works and which will write the file to filesystem, e.g. (note "tomcat" is the text string which may appear in the PID path name)



Then user has options:

1) change ownership of directory /mnt/nfs/Data/dev/downloader/file_downloader/TAN/ to JVM's user ID and give write permission to user



2) add JVM user to group which owns the directory and give write permission to group



3) give everyone (any user ID on the system) write permission



DISCLAIMER: I did not test any of the commands above, they are pseudo commands, may contain (and surely contain) syntax errors.
3 weeks ago
It looks like the code indeed should cause compilation error as  lambda body declares the same name variable as parameter, for example:

You should be prepared to different styles of code: e.g. a very long lines of pipelines, or several statements in a single line, or tricky indentation.

Assume such code:



(hopefully you were not tricked 8-)
Congratulations !

Glad to know my Java 11 study guide helped :-)

Good luck,
MZ