This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
as suggested in the IBM developerWorks journal, "Understanding bytecode and what bytecode is likely to be generated by a Java compiler helps the Java programmer in the same way that knowledge of assembler helps the C or C++ programmer."
After reading above page i want to ask, The terms Mnemonic,opcode,etc use in java byte code, same as System programming. Then why not we can see what is java bytecode generated by our java program. Is there any tool for that. Is we read source codeuse in the binary Java classes? I read this term in following links ------------------------ Byte Code Engineering Library
------------ I really confuse reading so much about java byte code but cant read simple java program's (which calculate 1+1=2) java bytecode. If system programming can done by human then is this also possible?
Millions saw the apple fall, but Newton asked why.
Hi. I don't know why we can't read bytecode from *.class files, but you should be able to find (google) some java byte code examples and tutorials. Have not checked links you provided maybe it's already there.
If it isn't I can tell you that java byte code is like asmbler for stack mashine, and you can find a lot of 2+2 examples.
Sorry, I have just noticed that I didn't understand you quite well. You have just asked why we can't read class files. Sorry. There were some java decompilers around, maybe one could use them to decompile a class file, but I am not sure if java byte code is what they produce.
Actually I already used decompiler once but if I remeber good I got only classes and methods names fromt it. [ July 19, 2008: Message edited by: denis sorn ]
Decompiling recreates the source code, so that's not very helpful in trying to find out how the JVM works. You can see the bytecode for a class by using the javap tool. Type "javap -c MyClass", and it will print it.
Where did you get the quote about bytecode and assembler from, Mandar Khire? Please quote a source.
It is absolutely true that knowing bytecode is as important for Java programming as assembler is for C programming. But what they don't tell you is that knowing assembler for C programming is as important as knowing the rules of the road is for fishing. That means: not at all.
You can program C without knowing any assembler and you can program Java without knowing any bytecode.
So i ask the above question for improving knowledge. Am i mistaking?
Joined: Oct 13, 2005
Originally posted by Mandar Khire: Am i mistaking?
No, not at all.
But you would have done well to quote the whole paragraph from Wikipedia, which clearly says you don't need to know bytecode.
I haven't got the time to read the whole IBM article yet, but shall look at it later.
Joined: Oct 13, 2005
Not sure about the Haggar article, which does make bytecode clear. But the article is 7 years old, so its conclusions might be out of date. Particularly about the relation between length of bytecode and performance. According to Brian Goetz (here) optimisation in Java is now done by the JIT (just-in-time) compiler in the JVM, and performance is variable from computer to computer. He says that writing simple code is the best way to get the JVM to optimise your code.
Although it is interesting to understand how bytecode works [it is very similar to assembler], and it is always useful to get additional knowledge, I still agree with what it said in Wikipedia that you don't have to know bytecode or assembler to program Java or C/C++.
I was thinking that, although interesting, its a bit pointless knowing what byte code will be produced, as the JVM will optimise the running code anyway, so gives little practical benifit.
I always believed knowing assemblier only ever became useful if you were having to optimise, for example knowing the shift operation would be quicker then a (power of 2?) division or multiplication. Thats sort of thing.
Just my thoughts
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Is Bytecode is under system programming language?