Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Elizabeth Jacob

Greenhorn
+ Follow
since Feb 19, 2001
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 Elizabeth Jacob

the requirements i know of are,that you need to be registered and that you should be posting replies in any of the forums.
Elizabeth
19 years ago
Regarding the Q1, if an overridden method( in the sub class)throws a checked exception it has to be a subclass of the exception thrown in the superclass.Here in option d) an Arithmatic Exception is being thrown which is an 'unchecked' exception and hence it does'nt matter the fact that it is not a subclass of IOException.
Elizabeth.
Hi Sunil,
For q1,i think u r right, since it clearly says to assume that each method is the only one being added.
For q2 ,i would assume that line of code is part of a try-catch block or a method that throws IOException. in the real exam u won't be confused like this.
Elizabeth.
Hi Kevein,
Ans 1.
a) is true since ArrayList implements List interface.
b) is false since ArrayList can increase or decrease in size.
c) is false since duplicate is allowed.
d) is false since keys and values are for Maps.
e) is false( i think).
Ans 2.
HashSet implements Set interface and does'nt allow duplicates. 2) is false as keys are for Maps.
Elizabeth.
Hi Jyotsna,
i got that point from RHE study guide pg no.193(of the fully revised version -the second edition) under 'Classes Defined Inside Methods'.
It says, "The immediate consequence is that classes declared in methods are private to the method and cannot be marked with any moeifier,neither can they be marked as static".
i thought it meant that method and the class can't be declared static too.
Elizabeth.
when i first started i was also much confused >< the two and u can expect questions on this inthe real exam.if u have RHE's certification guide chapter 4 will give you a good idea.then understanding exception handling-checked and unchecked exceptions also helps.
Elizabeth.
Here r some points i'd noted:
1.Abstract cannot be combined with private, static,synchronized,
final or native.
2.Methods can have more than one modifier but not access modifiers(such as public, private etc.) .
same modifier cannot appear twice.
3.Keywords 'super' and 'this' should'nt appear in a static initializer.
4.A constant(final) member must'nt be synchronized ,transient or volatile.
5.Constructors cannot be abstract.
6.Local variables cannot be declared as static.
7.Inner classes can be public, private, protected or default access and can also be marked static.
8.Static variable inside an inner class should be final.
9. Classes defined inside a method cannot have any modifier and
neither that method nor that class can be marked as static.
going thru the rules round up game in the JavaRanch and JLS gets u many.
Hope this helps.
Elizabeth.
Hurray!!!
It worked.this was the first time,i was ever happy to see an error message after a file being compiled.that simple quotes thing worked.
thanks again.
Elizabeth.
19 years ago
Hi all,
after posting the topic i had been out to the Dayton's daisy sale.i was so happy to see so many replies by the time i came back.i think i should get the things going now. Thanks to everyone of you.Marilyn thanks for the e-mail too.
Thanks,
Elizabeth.
19 years ago
Hi Guys,
when i try to save the file Say as Say.java,it is getting saved as Say.java.txt(till the reinstalling of my computer it used to be saved as a .java file).when i compile it,it's getting me the foll error,
"error:can't read:Say.java".
then i deleted the file and tried to compile it and it gives the same error as above, so i concluded that the saving as .java.txt could be a problem.
I've set the PATH and CLASSPATH as Richard had said.
could u pl help me out of this.
Thanks,
Elizabeth.
19 years ago
Thanks Richard,i'll try that.

Elizabeth.
19 years ago
i have'nt done that mock exam,but you can expect some 4 or 5 fill in the blanks,which u need to be very carefull while typing.
a correct answer mistyped makes it incorrect.
i remember getting only questions on java2.
Good luck.
Elizabeth
Thanks to both of you.
i'm working on windows 95.i set the CLASSPATH as c:\java & did'nt know what to do with the PATH variable.could you pl tell me how to set those two variables thru the DOS prompt.
Thanks,
Elizabeth.
19 years ago
Hi guys,
my computer needed to be reinstalled and then i downloaded jdk1.2.2 .I saved the file Say.java in c:\java .when i try to compile i'm getting the following error:
error:can't read: Say.java
could it be something with setting the PATH and CLASSPATH ?
Any help will be appreciated.
Thanks,
Elizabeth.
19 years ago
public class Sub extends Super{
int i,j,k;
public Sub(int m, int n) {
i =m; j=m;}
public Sub( int m) {
super(m); }
}
RHE says "the default constructor is not inherited;it is created
by the compiler if and only if you dont provide any other constructors in the source of the particular class."
whenever a constructor without the 'this' or 'super'keyword is
encountered the compiler adds an implicit call to super().so in
the super class if you are providing just one constructor as
super(n) then the compiler wont create the default constructor and it causes compiler error
so when this constructor
public Sub(int m, int n) {
i =m; j=m;}
is encountered the compiler has to create a default constructor of its super class.since there is an explicit call to
super(m) in the above example, you need to have Super() in the
Super class.
hope this helps,
Elizabeth.