Mr Iftikhar

Ranch Hand
+ Follow
since Oct 12, 2001
Merit badge: grant badges
For More
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 Mr Iftikhar

I have jdk1.3 .
I have make a program of first java servlet but I am getting the error that following is not found.
import javax.servlet.*;
Please tell me what I have to do for including that package in my program b/c I have copied the servlet classes on many places. But the path is not found in my program.
Do you have any experience in servlet or jsp or you have just prepared your self from the begging.
20 years ago
Can any one give me an example of recursion with
example and please also explain each step of recursion. Or give me a url for simples explaination of recursion. Thanks
20 years ago
int x=10;
switch(x){
case 1: System.out.println("one");
case 2: System.out.println("two");
case 3: System.out.println("three");
default: System.out.println("default");
}
the above code will work properly without break .
or if you will give the break in each case.
there is no effect on th ecode.
I have a .java file on drive c
c:\packageA\ClassA.java
And another file on drive d
d:\packageB\ClassB.java
//******************************************************
//************** ClassA's structure ********************
//******************************************************
package packageA;
public class ClassA{
public static void print(){
System.out.println("ClassA's method print");
}
}

//******************************************************
//************** ClassB's structure ********************
//******************************************************
package packageB;
import packageA.*;
class ClassB extends ClassA{
public static void main(String args[]){
print();
}
}

Can i compile both files simultaneously on d:\ prompt ?
How i will set the class path?
How i will run the ClassB.class (consist main method) file?
Is this right way please guide.
set classpath = c:\jdk1.3\bin;c:\packageA;c:\packageB
d:\packageB\javac ClassB.java
is giving the error in ClassB packageA is not exist.
I am a java programmer but i am not success to solve this problem.
please help me.
Thanks in advance.
I have studied about inner classes
nested inner classes
static inner classes
from Beginning java 2 ( ivor horton ) and
complete reference but i am not getting the concept of inner classes .
Is there any resources which will teach me in the easiest way that how inner classes works.
------------------
java language
Thanks Valentin Crettaz
This was a silly but i have not proper concentration.
What will happen if run the following code?
1: Boolean[] b1 = new Boolean[10];
2:
3: boolean[] b2 = new boolean[10];
4:
5: System.out.println("The value of b1[1] = " +b1[1]);
6: System.out.println("The value of b2[1] = " +b2[1]);
A) Prints The value of b1[1] = false
The value of b2[1] = false
B) Prints The value of b1[1] = null
The value of b2[1] = null
C) Prints The value of b1[1] = null
The value of b2[1] = false
D) Prints The value of b1[1] = false
The value of b2[1] = null
The answer is C .
please explain why answer is C . I think this is wrong.
Thanks Valentin Crettaz
I know the thing that the default value of object is null
and default value of boolean variable is false.
But how you are differenting the the line 1 is Boolean
object array and line 3 creating the Boolean primitive
array values.

1: Boolean[] b1 = new Boolean[10];
2:
3: boolean[] b2 = new boolean[10];
please explain me.
What will happen if run the following code?
1: Boolean[] b1 = new Boolean[10];
2:
3: boolean[] b2 = new boolean[10];
4:
5: System.out.println("The value of b1[1] = " +b1[1]);
6: System.out.println("The value of b2[1] = " +b2[1]);
A) Prints The value of b1[1] = false
The value of b2[1] = false
B) Prints The value of b1[1] = null
The value of b2[1] = null
C) Prints The value of b1[1] = null
The value of b2[1] = false
D) Prints The value of b1[1] = false
The value of b2[1] = null
The answer is C .
please explain why answer is C . I think this is wrong.
Yes the code is fine and will print 2 on the console.
Please tell me the names of best xml certification books.
How much data can store by 64kb memory.
21 years ago
Thanks Valentin Crettaz.
Select the correct answer.
Which one method can change the String object.
1) toUpperCase()
2) concat()
3) charAt()
4) substring()
5) non of the above

Is there any method which can change the String object.
(But String is Immutable.)