Kirti Dhingra

Ranch Hand
+ Follow
since Dec 13, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Kirti Dhingra

Originally posted by Dhaval Gandhi:
Dear Singh,,
are the RMI and JDBC topics included now in SCJP ??
How can I pass mock exams ??
Please Suggest ...
Dhaval.


No. But there were many questions regarding abstract classes.. If you have your basic concepts right, you can still pass the exam. I faltered in those questions in which you hae to do lot of mugging up. I think the best mock exams are of Marcus Green's, Majji's, Jaworoski's and RHE's.
Marcus Green is easier than the real exam by about 5%
Majji is nearly same as the real exam.
Jaworoski is also nearly same as the real exam.
RHE is easier than the real exam by about 7-8%
Though khalid also is very good, but I would not suggest you give it as it is very tough, can say nearly 25-30% as the real exam. If you get a low score, one may get a negative feeling. I got only 54% in Khalid's Exam.
K Singh

P.S. when ever you give mock exams, do a lot many together in cycles and never write or mark answers on the question sheet. By doing this you will not remember answers to the questions.
24 years ago
hello everyone,
Today I cleared my SCJP exm with 72%. I lost a lot in file and util packages and also in garbage collection. Anyway thanks to Javaranch and all its contributers.
K Singh
24 years ago
class InOut{
String s;
public void amethod(final int iArgs){
int iam;
class Bicycle{
public void sayHello(){
System.out.println(s);
}
}
}
public void another(){
int iOther;
}
}
The above code compiles well. But in some books it is written that only final variables be accessible to local inner classes.
K Singh
Q1. 4 objects are being created from two string literals. if i am wrong, then only 2 objects are being created. But 3 should not be the answer in any case.
Q2. A and C are correct. this() or super() have to be the first statement in the constructor.
Q3. Exception would be thrown only when you create an existing reference i.e. Object a;Object a;. But when a reference is created, it can be assigned to any object at any time.
K Singh
strictfp is a keyword but only for Java 2.
follow the above link.
hence if you have jdk 1.2/1.3 installed int strictfp; should not compile
K Singh
inner class should be compared to a method.
as a method cannot contatin static variable, inner classes can
also not contain any static classes,methods and variables
K Singh
class upper{
void ft(){
System.out.println("upper ft");
}
void gt(){
System.out.println("upper gt");
}
}
class lower extends upper{
void ft(){
System.out.println("lower ft");
}
public static void main(String args[]){
upper c=new lower();
((upper)c).ft();
((upper)c).gt();
}
}
output is is
lower ft
upper gt
regarding Q1
i++ returns i, but increases the value of i by 1
K Singh
it proves constructor are not inherited
K Singh
how good is 55% in Khalid's exam?
K Singh
I don't thing yield() is the correct answer. It only puts the thread to ready state but not stop it.
==

Originally posted by Sudhir Thorat:
What happens when you compare different primitive types other than int?
e.g.:
int i=123;
char c='1';
float f=1.0f;
if (f==c)
{ System.out.println("float 1= char 1);
}
if (123*f==i)
{stuff here
}
}


its b'coz char c='1' is not 1 but 49 (ascii value). If you put char c=1 or char c='ctrl+a', the the answer will be true.
K Singh
I think the static methods called on the object are in the class to which it belongs, not where it is referenced
e.g.
class duper{
static String greeting() { return "Super duper"; }
String name() { return "Anna"; }
}
class Super extends duper{
static String greeting() { return "Goodnight"; }
String name() { return "Richard"; }
}
class Sub extends Super {
static String greeting() { return "Hello"; }
String name() { return "Dick"; }
}
class statictest {
public static void main(String[] args) {
duper s = new Sub();
System.out.println(s.greeting() + ", " + s.name());
}
}
this code would print Super duper, Dick
K Singh