Thursday 8 December 2011

class file in java : representation of your data in class file ( try it ) !!


hello friends its cold in ma country and this topic is hot because we are dealing with java { hot-coffee } . see , people think that they can not use or they can not find any-thing from the class file but , i think you can find anything if you are serious for that thing specially in a java program . today i can say that if a person like me who is poor in studies can find some-interesting thing specially in java than any-one in this world can do anything specially in java . an advice from ma side is that , just devote your life to some topic or some fields than seriously you can feel the power of that special field .
today i am just explaining one topic because i just use ma 3-days in only in this topic and still i am not perfect so i think life is not created for being perfect its just created by god to try to be a perfect man . i respect god because he gave me a opportunity to give some-thing special to this earth . and still i am trying for providing some-small things at this level but i am glad because i just make a start , & seriously after some years  i will give more things to this earth .
see now come in a topic , i have a java program here i just enter a string and i am trying to find that how data is represented inside array .

here in image i have just enter a string and trying to find out how it is represented in the class file . for this i am using ” getBytes() ” method by this method your string is converted into the bytes and these bytes are represented and stored into the arr_1 [ ] and i have just printed that data with “Sytem.out.println()”  and see after it you will find the output in the UTF-8 format because inside get-bytes we are using it & the key point is that the UTF-8 format is same as ASCII format because every thing is entered by you from key-board is same as ASCII format thats why in next image i just converted data into hexa-decimal form .

now the interesting thing is that what will be my next step . for this i just use my class file and convert it into hexa-decimal form and in the hexa-decimal form i just find some great type of thing which motvates me and shows that i did it or i use my 3 days in a accurate way .


this image is croped but the main thing resides in this image and i think for me this is enough to explain . so the data in hexa-decimal is present in my class and this is the thing what i am trying to explain you . please try some-other example also , because java is infinite in  terms and in fields .
thanks for reading .


Wednesday 7 December 2011

some hammering problems in java


some question , if you are a java programmer or java user .
1. why java provides minimum support to boolean variables .
2. why java supports only 255 dimensions in array .
3. why java supports only 255 parameters in a function .
4. why java uses 9999999 values as a diffrentiator in representing values in the form of E form and in normal form .      example :– 10000000 is represented like 1.0E7 and 9999999 represented normally 9999999.

Monday 5 December 2011

run-time polymorphism in java .

if you are dealing with polymorphism in java than definitely at the start you will face the problem in the phase of run-time polymorphism . so do you ever think that what type of thing is happened at the time of run-time polymorphism . for this look at this picture ::--

in this figure i have just described the program , because we all deal with this type of programming in the phase of run time polymorphism , now think about the output of this program .


now think about this ... how this process is happening from the scratch or from the compile time , now see at this picture , this image is passed or this is the run_time_constant_pool which is passed after the compilation of the program .
so this text of information is passed at the time of run time see at the point 4 ... from point 3 ...
you can see that compiler told to jvm that there are two methods which are referencing from main-class(1) and support-class(2) . so at the compiler time methods are only checked that they are legal or illegal . and they are displayed or represented as legal .

now at the run time , we are taking run time because objects are created at run time and every linking is performed at run time .















Sunday 4 December 2011

difference between jdk-6 and jdk-7

hello every one , these days , you can easily watch or feel the effect of java in the whole world 3 billion devices  are using Java , this is great for me . but do you know now java is under the fame of oracle . and if you download the jdk  from the site you find that they are over-taked by oracle .

now what is the difference between jdk-6 and jdk-7 , here i am sharing my views what i feel , because i tried the both and found some-great things inside jdk-7 . for a programmer if you are an people who just believe in programming , there are no difference because he never wants to deal with those affects and i found those difference because i am a blank person in this world who is living without aim .

so have you ever heard about run-time-constant pool . i think this pool is hurted mostly , because i think pool of jdk-6 and pool of jdk-7 is changed totally . the most important sun introduced in jdk-7 is UTF-8 format , which is compatible with ASCIZ representation ( same as ASCII , difference is : followed by null { zero byte } ) and the benifit of UTF-8 is that multi-lingual support and comfort in encoding .

you can feel or use the run-time-constant pool using :
        javap -verbose classfile ( without .java )