Questions on real exam I had
Posted: Wed Dec 15, 2021 10:02 am
I had few questions I did not know the answer.
Such like:
1. What kind of methods we have to override to serializable the ClassA?
1) readExternal
2) readExternal and writeExternal
3) writeExternal
4) none
I decided to choose option 4. Because if we will implements Serializable we don't need to override, correct?
But the question didn't mention about if our class implements Serializable or not.
What do you think?
2. -noverify
I'm not sure the whole question was but there was a command with -noverify at the end of the line
(i choose option which says it exists since java 1.0)
one answer was "It will run java with latest version"
non of the options points to anything which says "class will not be verify or something"
3. What will print the correct path path= "/something/something2"
a). path.getRoot().getParent()
b) path.getRoot().getRoot()
c) path.getParent().getRoot()
d) path.getParent().getParent()
I was confuse about this question, there is no exception at all, is that correct?
Can you explain me what will be the difference between them? I choose getRoot().getParent()
4. Something about checking if path isDirectory
BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class);
BasicFileAttributes attr = Files.readAttributes(path, FileAtttribute.class);
BasicFileAttributes attr = Files.readAttributes(path);
BasicFileAttributes attr = Files.readAttributes(path, "isDirectory");
So I guess the correct syntax is option "a"
Anyway, is there any chance to see which questions I did wrong on exam?
Such like:
1. What kind of methods we have to override to serializable the ClassA?
1) readExternal
2) readExternal and writeExternal
3) writeExternal
4) none
I decided to choose option 4. Because if we will implements Serializable we don't need to override, correct?
But the question didn't mention about if our class implements Serializable or not.
What do you think?
2. -noverify
I'm not sure the whole question was but there was a command with -noverify at the end of the line
(i choose option which says it exists since java 1.0)
one answer was "It will run java with latest version"
non of the options points to anything which says "class will not be verify or something"
3. What will print the correct path path= "/something/something2"
a). path.getRoot().getParent()
b) path.getRoot().getRoot()
c) path.getParent().getRoot()
d) path.getParent().getParent()
I was confuse about this question, there is no exception at all, is that correct?
Can you explain me what will be the difference between them? I choose getRoot().getParent()
4. Something about checking if path isDirectory
BasicFileAttributes attr = Files.readAttributes(path, BasicFileAttributes.class);
BasicFileAttributes attr = Files.readAttributes(path, FileAtttribute.class);
BasicFileAttributes attr = Files.readAttributes(path);
BasicFileAttributes attr = Files.readAttributes(path, "isDirectory");
So I guess the correct syntax is option "a"
Anyway, is there any chance to see which questions I did wrong on exam?