Java - How to refresh knowledge? (2 years ago) - java

I have my first ever interview for a Java developer role, specifically RMI, Serverlets and JDBC.
However, it has been a while (2 years) since I have done any Java coding. I am sure I still have it up there somewhere and I do remember the Java syntax
I wanted to ask how can I re-fresh everything in 2-3 days specially the OOP concepts (polymorphism, inheritance) specifically to Java?
Any links, references and tutorials appreciated.
I am new to this site and I see there is a preference for programming related questions, hope I can get away with this!
Would also appreciate those that know any Java interview questions so I can go through them and test myself.
Thanks all

I'd suggest you you test yourself, e.g. on Java Black Belt, which has a good question base grouped by categories and detailled explanations for your mistakes.
I'd also recommend (re-)reading Sun's Java Tutorial and (longer) Thinking in Java by Bruce Eckel (3rd edition is free to download).

Tutorials on RMI
Java Servlet Technology
JDBC Tutorials
OOP concepts (polymorphism, inheritance): Head First Design Patterns
Java Interview Questions

How about this. Take a certification guide. It will save you a lot of time, and give you an exercise after every chapter (might give you some interview questions). You don't need to bore you down to death by teaching yourself in a wordy way, what you might already know. The best would he Khalid's Java Certification Guide. Believe me it would be faster and more effective. Plus give you the skills for appearing in the test for real, if you like to. :)

Related

C++ coming from Java and Objective-C

So, I know both Java and Objective-C quite well, but (perhaps strangely) never really learned C++. Obviously, the languages are all related, but there are syntactical differences that I don't fully understand. Is there a nice document that describes the basics of C++, but still assumes the learner knows a programming language? Perhaps even a tutorial that aims to describe the differences between the languages. This is what I'm looking for.
Also, is there a good tutorial on how to use C++ code inside a Mac or iOS app? The reason I feel the need to learn C++ is I'm trying to port a C++ program, and I heard you can use C++ code and just wrap it in an Obj-C GUI. Could someone point me to some documentation/tutorials on how to do this?
Thanks!
Even though the languages of this family are all related, that does not mean that you can casually move from one to the other and expect to write beautiful code. You have to learn the language's idioms and idiosyncrasies, and experience its strengths and way of thinking.
I would recommend reading Stroustrup's original book (a modern edition, of course). It's the most definitive reference (short of the actual standard) and it is very clearly written. The benefit of this approach is that you will be taught to think "how would I do this in C++", rather than "how do I transliterate this piece of Java code to make it compile". (Also this approach does away with any risk you might have of thinking you should "learn C first". Don't.)
On MacOSX, either download and build the free GCC, or get XCode (which comes with GCC). For iOS I don't know, I have a suspicion that you cannot deploy native code on it.
I would go for a pure C++ route, the quality of the material being the guide rather than finding ObjC+Java->C++ material.
At the university I am working for we have tried both ways for teaching C++ to students with a lot of programming experience, in particular Java experience, for obvious reasons.
The conclusion was that the specialized course did no better in teaching C++ than the generic one with some extra exercise materials. It's the quality of the teaching materials that matters.
Edit: You will probably receive a lot of good answers on the actual differences, also Voo's comment on your question is relevant.
I know what you feel - to have already worked on a couple of languages and learning C++. I was in the same boat too. While I was thinking for a while that it should be easy for me to learn it right away, it wasn't all that easy. So then I went back to the basics and started as a fresher to learn C++. 'C++ Primer' is an extremely good book to start with. Since you know most of the basics of programming, some of the first few chapters can be skimmed through. Once you are through with this, I'd recommend 'Effective C++' book and the C++ FAQs maintained here [http://www.parashift.com/c++-faq-lite/].
In fact, you could go through this FAQ first and see how much of it makes sense, and use that as a guide for figuring out where to do a deep dive.
HTH, K

Where to start if I want to understand how compilers and programming languages are made [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Learning to write a compiler
I know this is a broad question to ask, but where could I start learning how compilers actually work, how programming languages are made, I mean not how you use Java or Ruby but how people actually are making them. I will not try to replicate these languages in any ways but I want to understand the concepts and theory behind it. So what I need is either some directions on what I should search for, or even better and more appriciated are book recommendations.
Regards,
Jonathan Nash.
You might find Lets Build a Compiler by by Jack Crenshaw an interesting introduction.
Kept very simple and focussed on building actual functionality.
Compiler Constrution by Niklaus Wirth is pretty good and available for free from the link I provided (yes, legally). It's a bit old and uses Oberon for the examples but is easy to follow.
Create Your Own Programming Language by Marc-André Cournoyer is available online for USD 40 and consists of an eBook (including exercises and solutions), source code for two example languages (one in Ruby and one in Java) and a screencast on extending the JVM based language. This is probably the most newbie-friendly introduction you can find on the topic and afterwards you should have a pretty good idea about the steps involved (tokenizing, parsing, lexing etc.) and can continue your research with the provided links. It's a bit expensive, but IMHO it's worth it.
While not primarily a learning resource, the CoffeeScript web site has a section called "Annotated Source", which is really helpful in seeing how a programming language works. CoffeeScript's author started working on it after he read the book I mentioned in the previous bullet point btw.
You could take a look at the Dragon Book:
Compilers: Principles, Techniques and Tools by Aho, Lam, Sethi and Ullman
I've greatly enjoyed Language Implementation Patterns and learned a bunch. I wish I had read it before trying to implement a DSL some years ago.

Reading the java programming lanugage specification

I am preparing for SCJP 6 exam and I needed advice on the usefulness of reading the Java language specification. As the exam has to do with ones expertise in java code analysis. I am already reading SCJP A comprehensive by Khalid Mughal.
Also look at this also,
Don't miss this book for SCJP.
Perhaps useful, but not to prepare for the SCJP.
The SCJP tests your knowledge of the java.lang, java.util, java.io, and other core packages.
The language spec goes into the kind of detail that someone writing a JVM would need. It's not necessary for the SCJP.
But if you're game to dive in, I would not discourage you. Just understand what you'll get out of it and weigh that against your time constraints and opportunity costs.
My advice is this: Go to TopCoder, go to the algorithm section, look at solutions there. This serves three purposes, 1) You get to see how people obfuscate code, which is how it looks on the SCJP 2) You can see solutions and mistakes of people that have submitted and 3) It will give you a look at new problems and ways to test your Java knowledge, as well as your overall programming knowledge.
The book mentioned by org.life.java gives specific example of people who pass with very high correct answers rate. They simply write programs. A lot of programs. So if you want to pass this exam without an issue, all you have to do is just code. A lot.
Good luck!

Cannot get my head around concurrency in java, tried reading from the recommended books [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
OK I am not only new to concurrency in java but am also fairly new to java programming. I tried understanding concurrency from The java tutorials, tried reading Concurrency in practice but it seemed too advance, so tried reading from couple of other books: SCJP A comprehensive, The java programming language 4th edition.
Its as if there are things which just don't add up or make sense, I am not able to get the why's and how's and form the correct pattern of conceptual understanding. I apologize for describing this exercise in futility. But can someone please recommend good reading materials and/or ways to learn concurrency in java.
but am also fairly new to java programming
Leave the concurrency book aside for a few months and go ahead with reading a basic Java/SCJP book and practicing basic Java a lot. Create so now and then a Thread or Runnable as per the book's instructions. Play around with it for some months until you get a good grasp on it. Then continue with the concurrency book.
Learn walking before running, else you're crawling instead of running.
This sounds like you will soon be tested (class? certification?) "on Java concurrency". You have not experienced the cycle of running into a problem naturally, thinking about how to solve it, and turning to concurrency for a solution. If this is the case...
(1) Don't blame your brain. Rather, take a step back and start thinking about problems that interest you. Write them down. Internet applications are a good place to start. For example-- writing some sort of Internet server that can handle multiple connections from different users, like a game server. Or, a stock trading program that has to handle your robot's orders at the same time as processing information from the broker.
(2) Think concurrency. Now that you have a problem that interests you, and thinking of concurrency simply as multi-tasking, draw a diagram of actors/programs with arrows representing how they need to communicate with each other. Sketch out a dummy-skeleton code. You're not actually going to write a game server; but you can make a simple skeleton class library with simple, empty member functions like connectToGame(){}
(3) Now you're ready. Run a hello-world thread example or two. Flip through your books or browse the Javadocs and see the different concurrent structures that are available. Think about which ones you might apply to your problem. Don't worry about making the "right choice". You will soon find out if you've got something that works.
(4) Embrace trial and error. There is another word for it: learning!
Now, after you get some experience doing this, you'll be able to pick up a Java concurrency book and read about someone else's problem.
Hang in there and don't give up.
My favorite learning Java Book which has a great chapter on concurrency is:
Sun Certified Programmer & Developer for Java 2 Study Guide (Exam 310-035 & 310-027)
It's a difficult subject, nobody has full grasp of it, not even those who designed it.
Many people understand only a subset of it. If you only know a few tricks/patterns that you can use in your programs with confidence, that's good enough. From there you accumulate more and more.
A novice may only know that he can add 'synchronized' keyword to methods. Amazingly that solved a lot of problems and performs just fine, even if he has no idea what he is doing.
To add my two cents worth: concentrate on learning the concepts of concurrency first, rather than the machanics of actually using it in any particular language. If you get bogged down in language constructs it'll be all that much harder to get a high-level understanding of the subject.
To this end I would recommend How to Write Parallel Programs by Carriero & Gelernter (free & legal PDF download). It strikes a good balance between describing the concepts and providing concrete code examples, and doesn't get bogged down in theory. It's actually very readable and entertaining (or maybe that might be just me).
I feel like I understand concurrency backward and forward. Recently, I grabbed a book off the shelf in our office and found it was VERY good. Not just at concurrency, it gives great coverage of Java as a whole.
Introduction to Java Programming, Eighth Edition: Comprehensive Version, Y. Daniel Liang
However, most of my understanding came from experience working with code, tackling problems, and trying examples. I never truly understood threading until I did it.
Concurrency is complex and most people won't get it just from reading. Look through the API and write some test programs to try things out. Whatever book you choose, try to not just read the code, write it out and run it. After a day or two, working with it, you'll have it mostly figured out.

Programming with Java for beginners [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am a registered Student at a university in Switzerland, thus I know that programming is part of Electrotechnik (electrical engineering), the field I am going to take.
How can I learn programming with Java with easiest way, and without help by others?
I tried it through learning books, but I found it not easy, especially to do it alone.
For someone that knows nothing about programming, just reading tutorials will not do it for you. It would be good to download an editor and actually write the programs with any tutorial you use.
The thing about programming, the more you actually write the better you get at it.
Grüß, Thomas, if you haven't learned any programming it may be a little hard to start, but the Sun Java Tutorials are a good place to start.
Try the Java Tutorial. It will walk you through actual examples, with code that you can try out in various IDEs. I usually find that easier than reading a book.
Head First Java is good, if you can get past the style. Some people like it, others hate it (I haven't found anywhere in between). The funny part is the ones that like the style are the people who have more experience I find (not 100% true) but the book is aimed at those with little experience.
If you like the style it is a good book, if you hate the style, there are others, just let use know (as others have asked), are you 100% new to programming and if not what other languages do you know. Also what part(s) of the langauge are you having trouble with in particular?
In fact you have to learn two things, programming and Java.
I would recommend the book thinking in Java (Bruce Eckel), the current version is the 4th edition but you can download the 3th revision for free...
What books have you tried so far? When I started someone recommended to me "Sprechen Sie Java?" my Hanspeter Mössenböck which actually worked pretty well for me back then (having written not a single line of code before starting with Computer Science).
You could try a free course at Javapassion.
Another option for you if want to get a jump on your studies, you could go through the open courseware from M.I.T. For example, the Intro to Java Course.
Try the FREE book Java Programming for Kids, Parents and Grandparents by Yakov Fain
Get yourself set up and complete a "Hello World" tutorial, there are so many all over the next.
Once you know you can compile a Java program and view the output. Think of a small program. It might something as simple as converting Celcius to Fahrenheit and vice versa. Build that, using Google and whatever other resources you need to to find what you need to do. Once you get that running, think of something more complicated. Build that, keep doing this for a little while.
By building real apps, that give you something you want you will be much more motivated and you will understand what you are doing better because all the curly details haven't been solved for you the way they are in online or book tutorials. You may not use the most elegant design but you will learn more.
However at some point you will need to start to delve into books about Object Oriented architecture etc. but for now just jump in and force your brain to learn.
Another vote for actually doing some coding here. If you don't like the exercises in books then try programming something you're interested in personally. In my quest to learn C# I'm writing a program to correlate and display photos and GPS tracks and as a spin-off I'm trying to write a 3D graph component in WPF. Having a real problem I'm actually interested in makes a big difference to me, you can get a bit tired of implementations of bank account classes and vehicles.
Take a look at BlueJ. It was designed to teach Java
I recommend the Stanford course CS106A, which is available for free to download, and can also be found on iTunes. It's a great course, and the teacher is very enthusiastic:
http://www.stanford.edu/class/cs106a/
I agree with others that the Sun tutorials and the Thinking in Java free book are excellent, however, I don't think they can replace a video for someone completely new to the field.

Categories

Resources