Megha Jain

Ranch Hand
+ Follow
since Sep 12, 2005
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 Megha Jain

Hi All,

While using Eclipse 3.1 version i am facing this problem..........
We are using some Plugin congigured with Eclipse for our project, for that i created one workspace and did all the installation, but when i restart my machine my current workspace which i was using does not open(Just i see some intialization process running and then it stops) but if i create a new workspace it opens new one but not the earlier ones........ then again if i restart my machine, the one which i created now again stop working........

Bottom line: everytime i have to keep on creating new workplaces.

Same installation has been done by others on there machine........ but it's working fine there.

Can anyone please help and tell how to get over this.

Thanks
Megha
Hi,

Suppose a=2, and b=3;
if i say ,
if(a>b)
{...........
}// it will check whether value of a is greater than b or not. In above case a is less then b, hence condition fails and it will not enter into {..}

But if i write a>>b,
a=2 i.e in binary representation a=00000010,
b=3 i.e in binary representation b=00000011,

if i say a>>1, it will right shift the content once i.e new value of a=00000001 and the last bit is lost.

i suggest you to go through some examples.
18 years ago
For my web application which we have developed using J2EE , i have to provide atomatic faxing facility, can u please guide me with some guidelines how i can do it, just a start up, i am not understanding how to start it.
Thank you
18 years ago
Thank you for your suggection, i got it.
18 years ago
Thank you for your suggection, i got it.
18 years ago
Yeah, you are correct, actually when u said there should be a return type is thought you are saying this was
Area1(int side1, side2){
return someVarible;
}

you are correct.
I modified my code and now it's working fine.
Thanks everyone.


One more thing in my code which i have posted above i don't think i am actually making good use of interface , i mean can anyone suggest me some good implementation of it so that i can reduce my good length making use of interface.
18 years ago
I think, in interfaces we only declare the methods there is no need to declare the return type.

Actually once before when i have written the same problem it runned successfully, here when i am trying to do it once again it is showing problem. I am not able to point out where actually the problem is
18 years ago
Hi,

Actually for this program i had made two files,
1. DemoInterface .java
2. Area1.java

When i tried to complie any of the two files following errors were dispalyed

java 15:<identifier >expected
AreaCalculate(int length, int breadth);

java 16::<identifier >expected
Perimeter(int side1, int side2);

java 15:cannot resolve symbol Class AreaCalculate(int length, int breadth);

java 16:cannot resolve symbol Class Perimeter(int side1, int side2);
18 years ago
sorry i forgot to change that to public int Perimeter inspite of a4.perimeter, i tried that as well initially but still it was not working.
18 years ago
Hi,

i was trying one program on interface, i don't know where i am getting wrong, but when i complied the program at some other system some time back, it complied successfully and gave me the output, but when i tried it today i was getting errors.
Well one more thing, actually i was doing this to practise interface, but i think the logic or code which i am writing is wrong, so please see to it and suggest me,

Here's the code:

/* Program on Interface:

1. Create an interface Area with two methods:
a)Area(int side1, int side2).
b)Perimeter(int side1, int side2)

2. Create class Square that implements an interface Area, and defines above two methods to calculate area and perimeter of square.

3. Create class Rectangle that implements an interface and defines above two methods to calculate area and perimeter of rectangle.

4.Create class DemoInterface that uses class Square and Rectangle to calculate the area and perimeter of Square and Rectangle.*/

/********* This inteface i saved in same folder by name Area1.java *******8*/
interface Area1{
AreaCalculate(int length, int breadth);
Perimeter(int side1, int side2);
}
/******************************************************************/
class Square implements Area1
{
//Area1 a1=new Area1();
//Area1 a2=new Area1();
public int AreaCalculate(int l, int b)
{
int AreaSquare=0;
AreaSquare=l*b;
return AreaSquare;
}

public int Perimeter(int s1, int s2)
{
int perimeterSquare=0;
perimeterSquare=2*(s1+s2);
return perimeterSquare;
}
}

class Rectangle1 implements Area1
{
//Area1 a3=new Area1();
//Area1 a4=new Area1();
public int AreaCalculate(int l, int b)
{
int AreaRect=0;
AreaRect=l*b;
return AreaRect;
}

a4.Perimeter(int s1, int s2)
{
int perimeterRect=0;
perimeterRect=2*(s1+s2);
return perimeterRect;
}
}

public class DemoInterface
{
public static void main(String[] args)
{
int AreaOfSquare=0, AreaOfRect=0, PerimeterOfSquare=0, PerimeterOfRectangle=0;

Square sq1=new Square();
AreaOfSquare=sq1.AreaCalculate(10,10);
System.out.println("Area of Square is ="+AreaOfSquare);

Square sq2=new Square();
PerimeterOfSquare=sq2.Perimeter(10,10);
System.out.println("Perimeter of Square is ="+PerimeterOfSquare);

Rectangle1 rect1=new Rectangle1();
Rectangle1 rect2= new Rectangle1();

AreaOfRect=rect1.AreaCalculate(4,4);
System.out.println("Area of Rectangle is ="+AreaOfRect);

PerimeterOfRectangle=rect2.Perimeter(4,4);
System.out.println("Perimeter of Rectangle is ="+PerimeterOfRectangle);

}
}
18 years ago
Hi,

Can anybody expalin me what is "ANNOTATION".
I read this abt it...... but still finding it difficult to understand

Introduced in J2SE 5.0, annotations provide a way for programmers to instruct the compiler on how to handle certain situations. For example, an annotation can indicate that a particular method or class should be overridden in a subclass or that certain compiler error messages shouldn't be printed.

If anyone ccan help me out.... i will really appreciate
18 years ago
Thanks for that......
18 years ago
Also tell me if i want that comparision of sb1 and sb2 should return true value.......... let me make myself more clearer...
I have created two instances of string Buffer and have stored same value in both say "Megha". as they are pointing to different memory locations, but i want to only compare the contains only and as both contain "megha" , it should return true value...
But when i write ....
SOP(sb1==sb2) it returns false....... how can i modify it so that i compare only the values and true value is returned
18 years ago
Hi u have written......

System.out.println(sb1.equals(sb2));

will of course be false since the equals method in the Object class just checks if its the objects equals, not the content of the StringBuffer.

Then why this statement evaluates false

System.out.println(sb1==sb2);

As both contain "Amit"
18 years ago
Hi,
i have written this program,
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));
System.out.println("Poddar".substring(3));
StringBuffer ss2=sb1;
System.out.println(ss2.equals(sb1));
System.out.println(sb2==ss2);

and got OUTPUT::
false
false
false
dar
true
false

Actually i want to undersatnd this in terms of object refernce. What actually takes place in memory. So that i can understand String buffer much better as i am always confused with it.
18 years ago