trupti zanjad

Greenhorn
+ Follow
since Aug 03, 2007
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 trupti zanjad

hello,

I want to report in jsp, so is it possible to call n number of jsp pages by writing only 2 pages of jsp
1> on one page i will have list of reports, as the user clicks any report he/she wants,
2> on second page the data will be displayed for that particular report.
please guide me on this topic.
thank you,
trupti.
12 years ago
JSP
my question is as follows,

public class Inc{
public static void main(String argv[]){
Inc inc = new Inc();
int i =0;
inc.fermin(i);
i = i++;
System.out.println(i);
}
void fermin(int i){
i++;
}
}
ANS)1 Compile time error
2 Output of 2
3 Output of 1
4 Output of 0

The Correct Answer is
4) Output of 0

Explaination:
The method fermin only receives a copy of the variable i and any modifications to it are not reflected in the version in the calling method. The postincrement operator ++ effectively modifies the value of i after the initial value has been assigned to the left hand side of the equals operator. This can be a very tricky concept to understand

why does any modification done don't reflect the method?
and why the value assigned by the post increment don't affect i variable?

please kindly guide me, i have not understood the above topic.
thank you,
trupti
class Zoo
{
public String coolMethod(){
return "Wow baby";
}
}

class Moo
{
public void useAZoo(){
Zoo z=new Zoo();
//If the preceding line complies Moo has access the Zoo class.
//But... does it have access to coolMethod()?
System.out.println("A Zoo says " +z.coolMethod());
//the preceding line works because Moo can access the public method
}
}
i have complied this code and when running the program it exception java.lang.NoSuchMethodError:main
this examples is from K&B page no 25
there is point, "whether method code in one class can access a member of another class"
please guide me for the above code.

thank you,
trupti.
hello,
i have doubt in static methods, as static method can't be overriden,how is it possible to access the behaviour of super class in base class.i have code
class Animal
{
static void dostuff(){
System.out.println("aaaaaa");
}
}

class Dog extends Animal
{
public static void main(String[] args){
//Animal a=new Animal();
//a.dostuff();
//Animal a1=new Dog();
//a1.dostuff();
Dog d=new Dog();
d.dostuff();
}
}

though i now static methods are not overriden, as they method and can be accessed in base class through hidding ,but here i not used the static method then i able to access it .if i am wrong please guide me.
thankyou,
trupti.
hello,
i have doubt in static methods, as static method can't be overriden,how is it possible to access the behaviour of super class in base class.i have code
class Animal
{
static void dostuff(){
System.out.println("aaaaaa");
}
}

class Dog extends Animal
{
public static void main(String[] args){
//Animal a=new Animal();
//a.dostuff();
//Animal a1=new Dog();
//a1.dostuff();
Dog d=new Dog();
d.dostuff();
}
}

though i now static methods are not overriden, as they method and can be accessed in base class through hidding ,but here i not used the static method then i able to access it .if i am wrong please guide me.
i have diffculty in assertion, i refering to Kathy Sierra for SJCP 5.0 book,in this book Chapter 5 they Assertion as subtopic in this they have told about assertion mechanism in that Using Assertion Appropriately is an sub topic in assertion topic.
In that Dont'use Assertion to Validate Arguments to a public method and
Do use Assertion,Even in public methods,to check for cases that you know are never ,ever supposed to happen.these are to point in Using Assertion Appropriately.
first point i have understand but regarding second i have doubt please help me for regarding topic.
thankyou,
trupti
it would be really very kind, if you would please help me out,i have problem regarding Generics and Enums,i am preparing for SCJP 5 and am not able to understand these topics.
please help me.
thankyou,
trupti.