Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Ahmad Mudassir

Greenhorn
+ Follow
since Oct 16, 2000
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 Ahmad Mudassir

Thanx deekasha for your clarity
Hello !
My Question for the managers of this site
can we inherit a subclass from inner classes if yes than how?
the other question is what are the valid declaration of the inner classes as follows
2. Given:
public class OuterClass {
private double d1 = 1.0;
//insert code here
}
You need to insert an inner class declaration at line 3. Which two inner class declarations are valid?(Choose two.)
class InnerOne{
public static double methoda() {return d1;}
}
public class InnerOne{
static double methoda() {return d1;}
}
private class InnerOne{
double methoda() {return d1;}
}
static class InnerOne{
protected double methoda() {return d1;}
}
abstract class InnerOne{
public abstract double methoda();
}
the third question is whether i have heard from a person given the exam that we also have to write code there e.g how to declare inner class etc.. (this was not in the exam).
waiting for the reply
Thanx
Ahmad
hello John !
don't worry attempt it again with practice of sample questions and don't worry about the code. make it up and keep strong belief that you will 200% get through in the next attempt.
I hope you for the best.
Good Luck
hi every one !
Some words about casting that you can cast any primitive to any other primitive type except boolean.(from higher to lower capacity otherwise from lower to higher implicit cast is done)
And with objects you can assign reference of an object to any other object with casting(subclass object reference to superclass object reference or to an interface which is implemented by that class is done through implicit cast).
But what in the case of Wrapper classes they can not be cast to each other why?
is because they are final. so final class object's references can not be casted.
Any one can solve this problem
Hi every one !
What is the output (Assuming written inside main)
String s1 = new String("amit");
System.out.println(s1.replace('m','r'));
System.out.println(s1);
String s3="arit";
String s4="arit";
String s2 = s1.replace('m','r');
System.out.println(s2==s3);
System.out.println(s3==s4);
correct is
arit
amit
false
true
but i think it s2 also equal to s3
could any one clear this.
Hi,
could any one tell about the following code.
String s5 = "AMIT";
String s6 = "amit";
System.out.println(s5.compareTo(s6));
System.out.println(s6.compareTo(s5));
System.out.println(s6.compareTo(s6));
it would print
-32
32
0
how we calculate -32 and 32
Any body can tell me that can we compare StringBuffer to String object through equals method
StringBuffer sb1 = new StringBuffer("Amit");
StringBuffer sb2= new StringBuffer("Amit");
String ss1 = "Amit";
System.out.println(sb1==sb2);
System.out.println(sb1.equals(sb2));
System.out.println(sb1.equals(ss1)); //this one
System.out.println("Poddar".substring(3));
Thanx
And if i m not wrong passing marks are 61%. pl. verify it.
i got this information from one of my friend.
Ahmad
you can extends interface from interface no restriction and as many as you can.
real example from jdk is Externizable extends Serializable which i know.
Ahmad
i wonder how you compiled test class by java temp56.
any way if you are getting 1 as a output its right.
As comes into the check if args>0 and 2-1 is 1
Ahmad