write a class to input 2 points by the user & check the line
maked by the points is horizontal,vertical or rectangle?



write a class to input 2 points by the user & check the line maked by the points is horizontal,..

Answer / murli

if (x1,y1) and (x2,y2) are two points..then line made is horizontal if (y1==y2).vertical if(x1==x2).Two points can never form a rectangle.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

Difference between local and global transaction ?

1 Answers   Accenture, iFlex,


What is finally block?

0 Answers  


What is a Presistent Object?

0 Answers   InfoAxon Technologies,


What is Transient and volatile

10 Answers   iFlex,


Map map = new HashMap(2); map.add(“1”,”one”); map.add(“2”,”two”); map.add(“3”,”three”); What will happen at this line?

5 Answers   Rolta,






Explain the difference between throw and throws in java?

0 Answers  


How can you traverse a linked list in java?

0 Answers  


what is the main difference between string and stringbuffer? can you explain it with program?

2 Answers  


Can a class have more than one object?

0 Answers  


What is the use of an interface?

3 Answers  


What ide should I use for java?

0 Answers  


Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?

0 Answers  


Categories