I'm writing a bachelor's thesis on "Analysis of the source code in Java applications". I have a few points that must include written part. One of them is "a brief description of the grammar and writing Java." Since this is a bachelor thesis, sources of information must be verified - the books, the official site of Java, etc. Unfortunately I can not find this information on the Java website (maybe I'm just casually looking for). If possible, it is easier for me to use online resources than books.
Can anyone advise me where I found this information verified? Of course we were in school in certain subjects taught either syntax or semantics of Java, but it does not seem so "official source".
Thank you all.
Use the official Java Specification from Oracle.
http://docs.oracle.com/javase/specs/jls/se7/html/jls-2.html
I think that Code Conventions for the Java Programming Language is good place to start.
For static code analysis in Java you can find some automated tools.
Static Code Analysis Tools
Have you tried google scolar.
Scolar only gives proper scientific results.
for instance you might like this article
Related
Right now I'm watching the Stanford's channel in youtube, and to be precise I'm watching the Java lectures by Professor Mehran Sahami. I already have some level of theoretical knowledge of Java but I find these lectures very interesting but there's one thing that confuses me and I want to clarify it before going any further.
In the examples there are a lot of differences from what I've seen so far in the books I've read and even in the original documentation of Sun. In these lectures the main method is as it seems public void run() insted of public static void main(String[] args). For console output he uses only println() instead System.out.println() and I suggest that going more deeply into the Java language there will be even more differencies from what I would call "the standard syntax."
From what I understand all this come from using the ACM package and I really don't know if keep watchng this will help me or just gonna confuse me more. Is this ACM package of some practical use? Does it make the Java syntax a lot more different than usual so I could end up with bunch of useless commands? Do you think it would be better to leave these videos for now and come back later when I can get use of the useful information and be more aware of the outdated stuff or the difference is not that big?
Thanks in advance
Leron
I don't think it's going to get in the way of learning Java. It provides a framework within which your code will run, much as do Java applets, Swing, Android, or some other framework. It will not be the same as vanilla Java, but the ACM package is well documented. Once you master the basic concepts, learning the extra stuff you will need to wean yourself from the ACM package won't be hard at all.
As long as you recognize the differences between the "shortcuts" provided in the ACM code and the standard syntax, I don't think there's any inherent harm in following these lectures. I've heard some decent things about the series, and if your goal is to learn the basics of the language (or fill in gaps in existing knowledge), then I think it's a fine resource.
On the other hand, I have never seen the ACM libraries used outside of an academic setting. Personally I only used them once, on a single project for a single (non-required) class while I was persuing my undergrad degree. If you're already familiar with the language, and know the basic concepts, I'd look for more standard tutorials that don't make use of esoteric or specialized code bases. For the most part, the ACM libraries seem to contain shortcuts and a standardized framework to aid in teaching (and learning) core concepts rather than worrying the exact syntax or any quirks that might be present in the language.
If I want to summarise it, I would say that the ACM Java Libraries main goal is to make you free from the syntax to help you focus on the concept.
The ACM Java Library package is an excellent tool to introduce programming concepts to newbies. As you can see the lecture's title is Programming Methodology and not Programming Java.
Hope it clarifies
I'm in this exact same situation. Rather than learning ACM, which I'm not going to use anywhere else, I decided to do the assignments using current Java technologies, for example doing the graphics portions in JavaFX. Of course this might not be the best approach for absolute beginners, who may find it easiest just to stick with ACM.
In case it helps, I'm putting my coursework in GitHub:
https://github.com/bmaupin/coursework/tree/master/cs106a-stanford
For example, here's the Target assignment: https://github.com/bmaupin/coursework/blob/master/cs106a-stanford/Assignment2/Target.java
I am trying to create a lexical analyzer program using java.Program must have the concept of tokenization .I have beginner level knowledge in compiler programming.I know there are lot of Lexical generators exist on internet.I can use them to test my own lexical analyzer out put .But i need to do my own lexical analyzer .Can any one please give some best references or articles or ideas to start my cording ?
"Compilers Principles, Techniques and Tools" by Aho Sethi and Ullman has a chapter on lexical analysers. It includes a lot of the theory on regular expressions and finite automata that are core to this problem domain.
I would try taking a look at the source code for some of the better ones out there. I have used Sablecc in the past. If you go to this page describing how to to set you your environment, there is a link to the source code for it. Antlr is also a really commonly used one. Here is the source code for it.
Also, The Dragon Book is really good.
As Suggested by SK-logic I am adding Modern Compiler Implementation as another option.
I know the .Net framework very well and know where to find things ie: StreamReader, StreamWriter, Graphics, etc, and I know Java has similar things. The syntax is different but quite similar to c++ which I have a lot of native c++ experience. Therefore, what would you recomend as a good starting point for tutorials and such. Thanks
In my new job, I quickly found myself working on a common library in C++, C# and Java. I had no Java knowledge and yet found it pretty intuitive to make simple mods to the Java code - the general C# principle that there is a framework class/namespace for most things you want to do, appear to hold in Java.
The thing that bothers me is that this MO would not teach me tricks and improvements in Java that are specific to that language. That's where I would like to see other answers to this question lead.
In the meantime: http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java
btw while I found C# and Java pretty congruent, I would not say the same about C++ vs Java.
If you work in eclipse/netbeans/intelliJ it may actually be a no-brainer. Guess at a class name, start typing it and hit ctrl-space (for eclipse, others vary). Regardless of which package it is in, it will find all the classes that match and list them for you faster than you could look them up anywhere else.
The other really nice thing to have on hand is the javadocs for the SDK you are working with--you can code effectively with nothing else. They are online (just search for JDK 6.0 or whatever version) or they can be downloaded from the same place you get the JDK.
The javadocs are your friend - once you figure out some of the main packages in java.*, it's easier to know where to look for specific classes / functionality.
Once you're writing some code, buy Effective Java - it's full of tips for the language, and is just a good programming book.
I've been programming in Java for about 4 years now, but what I've learned was self-taught--I've never taken a formal class for the language. Recently at my job I heard two guys arguing over something called the "java standard" of programming that "99% of all professional java developers use." I've never heard of nor intentionally used this "standard" while writing code in java, so I guess I've gotten off easy with the bosses so far.
Is this so-called standard as popular as my coworker proposed in the java developing community?
I would say so - to a greater or lesser extent.
I'd say almost everyone follows most of Sun/Oracle's Code Conventions for the Java Programming Language document - but many places tweak it. For example, I've very rarely seen much Java code which doesn't follow its naming conventions for methods, but often organisations will have their own whitespace conventions.
Have a Formal look # Coding Standard Doc By Sun [Oracle] :)
Not knowing what your co-workers were arguing about, I cant tell for sure what standard they were referring to.
Here is the code convention guidelines published by Sun (now part of Oracle). http://www.oracle.com/technetwork/java/codeconvtoc-136057.html
I have been writing Java for a long time, there used to be some books on the Java Language that Sun used to put out, they are no longer kept up to the latest version. The latest book is for 5.o and we are almost up to 7.0.
The standard is anything here:
http://download-llnw.oracle.com/javase/6/docs/
The coding standard books that are mentioned are useful as far as style to program in, but they do not cover the newer versions of the language.
Maybe you could ask your coworkers for a copy of this information they are referring to and post it here to enlighten us ?
HI. I am a beginner/intermediate java programmer.I'd like to see codes of useful applications used in the real world. Could anyone tell me where to look for such source codes? thanks.
SourceForge has numerous open source projects which use Java in some way. On the first page you'll see a lot of popular software you've probably used before.
I would also recommend searching Google Code ( http://code.google.com/ ) for Java programs.
This last suggestion is a bit unorthodox, but have you considered competing at TopCoder.com? After the first competition round you have the option to look at others' code. The flip side is that you need to apply critical thinking - not everyone's solution will be correct, much less optimal! You can't get any more real-world than that.
Good luck!
thank you Arkaaito.
I found the google code website very confusing to search. I didn't get many relevant searches for Java when I typed "java source code" into the search box. I'll continue trying.
As for competiting on Topcoder.com, I am not good enough in programming java to do that...perhaps you could suggest more links for me to study from to improve my skills?
I enjoy java labs that build on my programming fundamentals :-)
cheers.