Deepakk Verma

Ranch Hand
+ Follow
since Sep 09, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Deepakk Verma

I made this code as a practice exercise......this program should be controlled with simply four
cursor control keys and each key must be assigned a method.....i.e., by pressing a particular
key some operation must be performed....what this program do is it should just reflects the changes in the distance traveled and speed of cycle by accelerating and decelerating the cycle and it should also change direction of the cycle(of course imaginary one since i haven't reached to the topics using graphics) .........as stated below

right cursor key(-->) : turnLeft().....and should change the direction as per the code
left cursor key(<--) : turnRight()....and should change the direction as per the code
up cursor key(<) : paddleMoving(int i)....here 'i' states for number of paddle rounds user
wants to apply which would be asked in the starting of the program
down cusor key : applyBrakes()......which eventually stops the cycle.

but the problem is that i dont know how to use Scanner for cursor keys...therefore i have left the class containing main() method.....Please help

>
15 years ago
OOPS.....i should have taken care of that ............Thanks Maneesh
15 years ago
I am having error in the program can anybody help please


Error is in 7th line as:
Type mismatch: cannot convert from char to String
15 years ago
Can we apply right shift(>>), and left shift (<<) operator to float and double type values?..
if not why?
Please explain...
15 years ago
Is new used only to allocate memory for an object.......i mean if i do something like

Will this create an array of integer type or there is some predefined class named as int whose
object is it creating.....
please explain

if somebody else also has some useful information regarding new then please share
15 years ago
It took me a little while to grasp the idea but i thing i am able to digest the concept now
Thank you very much Mr Pankaj for your valucble efforts to explain this all....
Thank you again
Deepak Verma
15 years ago

4. Using RefVariable you can access static variable of superclass.


Can we also access the private instance variables of the superclass by RefVariable?
15 years ago
i know that and i also apologized for it
actually i gave the 128 value by mistake in that post so please dont be annoyed
15 years ago
i have a shadow of doubt about the concept of object declaration
i would illustrate my doubt with an example




The statement

superclass RefVariable = new subclass();

it will create memory space for an object of "subclass" class and would appoint a variable of type superclass named as RefVariable with the reference of the object created .....
Now my questions rare :
what this RefVariable actually contains?
what are its capability?
Is it carrying a pointer to the superclass object?
Or is it carrying some sort of address to a memory location?
I am really confused with this....please help
15 years ago
soory for the misteake......it was 127+127
and was getting -2.....
please try once more
15 years ago
if i change this code to



then why is it showing me result as -2
point to be noted is: byte range is -128 to 127
so what it should do on line 14 is add the two number
127+127 i.e, 254
there will be no changes in the value since 127 is in the range of byte
now it will do type casting and will display the reduced modulo(the remainder of an integer division by the) byte's range(which i guess is 127)

and the result should be

254/127=2 with remainder =0
thus 0 should be the result but it is showing me -2 ?........Please explain
15 years ago
allright..that is a lot of valuable information you gave me....
thanks very much to you all especially to Rahul, Campbell and D. Ogranos
Deepak Verma
15 years ago
if i write this code


it is giving me result as

myboxBox@19821f


can you tell me why?
(i know this code is of no use but i was curious to know why is it generating this output)

please explain....
15 years ago
ok....now i got it
Thanks Mr.Rahul
15 years ago