Best products from r/javahelp

We found 50 comments on r/javahelp discussing the most recommended products. We ran sentiment analysis on each of these comments to determine how redditors feel about different products. We found 61 products and ranked them based on the amount of positive reactions they received. Here are the top 20.

Top comments mentioning products on r/javahelp:

u/high_hobo · 1 pointr/javahelp

I actually ended up helping a few people on this exact problem. Small world, eh?

The way I would have designed it would be to start at how I wanted to use the system. This may seem odd and fairly abstract, but can lead some detail as to how it can be done:

Car entrant = new Car("Ford Fusion"); // or whatever
Spot spot = carPark.park(entrant);

if (spot == null) {
System.out.println("Could not find a spot for the car!");
} else {
System.out.println("Car was parked at: " + spot);
}

This tells me I automatically need a few things.

  1. We need a Car class
  2. We need a Spot class
  3. We need a CarPark class
  4. In the car park class, there is a method to park a Car and returns the Spot that the car was parked into; if available, otherwise null.

    So what was the purpose of this exercise? Merely to show one way to approach the problem. I'd personally say that the code above is fairly clean and understandable, would be a good way to have the final implementation be written.

    ---

    From here you have a few options. One I found to be quite nice was having a Floor class that contains all the Spots available for that floor. This kinda makes sense, as multiple Floors make up a single CarPark and will usually be very very similar.

    Then as for parking the car, a modified Visitor Pattern was used. Which might seem a little confusing at first. However, think of it in the real world. A car will keep visiting available floors until it either runs out of floors or finds a spot to park. Just as you would do as you are trying to find a spot to park in.

    So in the end it could look like:

    public class Car {

    public Spot visit(Floor floor) {
    // find suitable empty spot
    }
    }

    public class Floor {

    private final List<Spot> spots; // all available spots

    }

    public class Spot {

    // type, availability, etc...

    }

    public class CarPark {

    private final List<Floor> floors;

    public Spot park(final Car vehicle) {
    for (Floor floor : floors) {
    Spot spot = vehicle.visit(floor);
    if (spot != null) {
    return spot;
    }
    }
    return null;
    }
    }

    Very bare-bones implementation, but a good starting block. Here, I designed it with the real world in mind. Car, CarPark, Spot, these are all tangible real-world objects. And a CarPark is basically a bunch of Floors and each Floor has certain Spots available to it.

    This design here should mirror the real world fairly nicely. That is the purpose of OOP. Its to you can say things like carPark.park(car); and understand what that does.

    ---

    Hopefully you understood the steps I took here. If anything was too confusing, not explained in enough depth or anything, feel free to ask.

    As to learning this stuff, here are my recommendations in order of importance:

  5. Write more programs like this. 'Simulations' like this are often based off of the real world and have a very nice OOP model.
  6. See if your university/college offers a Software Design class. These are based off of OOP like 99% of the time and go over patterns like Visitor, Adapter, Singleton in far more depth as well as teaching you how to come to that conclusion.
  7. Check out a few books. Design Patterns is fairly in depth. Personally, I have a few OOP books and one I found to be quite nice is Object Design: Roles, Responsibilities and Collaborations

    Hopefully this helped clarify a few issues here.
u/throwaway0891245 · 1 pointr/javahelp

I have some recommendations on books to get up to speed.

Read this book:

Hands-On Machine Learning with Scikit-Learn and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems

This author does a really good job going through a lot of different algorithms. If you can wait, then go with this book instead - which is by the same author but for TensorFlow 2.0, which is pretty recent and also integrated Keras. It's coming out in October.

Hands-on Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems

You can get good datasets on Kaggle. If you want to get an actual good foundation on machine learning then this book is often recommended:

The Elements of Statistical Learning: Data Mining, Inference, and Prediction, Second Edition (Springer Series in Statistics)

​

As for staying up to date, it's hard to say because "machine learning" doesn't refer to a single thing, there are a lot of different types of machine learning and each one is developing fast. For example, I used to be pretty into recurrent neural networks for sequence data. I haven't kept up with it lately but I remember about two years ago the hotness was all about LSTM neural networks, but then a simplified gate pattern was shown to be just as good with less training and that became big (name is escaping me right now...). Then the last time I took a look, it looked like people were starting to use convolutional neural networks for sequence data and getting great results on par or better than recurrent neural networks.

The ecosystem is changing fast too. Tensorflow uses (used?) static graph generation, meaning you define the network before you train it and you can't really change it. But recently there was more development on dynamic neural networks, where the network can grow and be pruned during training - and people were saying this is a reason to go with PyTorch instead of Tensorflow. I haven't kept up, but I heard from a friend that things are changing even more - there is this new format called ONNX that aims to standardize information about neural networks; and as I've mentioned earlier in this post, TensorFlow 2.0 is coming out (or out already?).

I'm not doing too much machine learning at the moment, but the way I tried to get new information was periodically looking for articles in the problem type I was trying to solve - which at the time was predicting sequences based on sparse multidimensional sequence data with non-matching step intervals.

If you read the TensorFlow book I linked above, you'll get a great overview and feel for what types of problems are out there and what sort of ML solutions exist now. You'll think of a problem you want to solve and then it's off to the search engines to see what ideas exist now.

u/jbacon · 1 pointr/javahelp

Here's pretty much your most basic flow for problem 3:

  1. Find the square root of your target number.
  2. Starting at 2, check if target % loop counter == 0
  3. If yes, store as a factor and divide your current target by that number. Use that as the new for loop end condition. Find the complement of that factor, and store that as well.
  4. Go through all the divisors you found and test if they are prime.
  5. The largest remaining number should be your solution.

    To troubleshoot, use a debugger (Eclipse's builtin is nice). If you feel it's taking too long, break the program's execution and check its state. Is the loop counter about where it should be? Are the found divisors plausible? Is the loop end target plausible? Set a breakpoint on the first line inside the loop and keep stepping through (either one line at a time if you like, or just hit 'resume' and it will break again at the top of the next loop iteration).

    I learned Java throughout college, as it was the primary teaching language. Honestly, the best way to learn is just to WRITE CODE. Solve problems that you don't know how to solve. Invent random things that are useful to you. Your code doesn't have to be perfect when you're learning (and it definitely won't be!), and what is important is that you constantly look for ways to improve. I want you to look back on code you've written a year ago, and think that it's absolute crap - that will show that you are learning and improving.

    Somewhat counter-intuitively, the best resources are books! I'll list some recommendations below.

    Keep these principles in mind:

  6. Don't repeat yourself. If you're copying and pasting code, it is wrong. If there is not a single point of truth for each piece of information in your code, it is wrong. Find ways to keep your code clean and non-repetitive.

  7. Document everything. Comments - comments everywhere. Explain what ever piece of your code does. Explain what each method's arguments are, what it does, and what it returns. If you don't know, then that's a big red flag to reevaluate your design. If a bit of code is doing something complicated, write inline comments explaining what each bit does. All this is for future you - I can hardly remember code I wrote last week, let alone a year ago.

  8. Separation of concerns. Each piece of code should only work with what it is directly responsible for. UI code should deal with presentation. Application logic should deal with data manipulation. A persistence layer should handle any database or serialization of things. Keep your code loosely coupled!

  9. Design patterns. There are dozens of semi-formal patterns used to solve common problems in software. Learn to recognize these problems, when to apply these patterns, and how to modify them to suit your goals. See Wikipedia, or Design Patterns by the Gang of Four.

  10. Be pragmatic. What does your code really need to do? What is the minimum that it needs to accomplish, and how can you keep it extensible enough for future expansion? The answer to the last part is largely the previous points - well designed code is always easily changeable. The Pragmatic Programmer is another excellent book. It even comes with a handy summary sheet of its main points!

  11. TEST! Write lots of unit tests. Make sure that every piece of your program is tested to be correct. Every time you find a bug, write a test for it so it never happens again. If a piece is difficult to test, it may mean that it is poorly designed - reevaluate it. This is guaranteed to save your bacon at some point - you'll probably hate the work, but the safety net is invaluable. Being able to instantly tell if you program is working properly is invaluable when making changes.

    Once you start getting a feel for Java, which I think you might be already, Effective Java is the book. You probably won't need any other resource for Java itself.

    If you need help with something, Reddit is a great place, but Stack Overflow is the programmer's mecca. The best resource on the web for just about everything software, and their sister sites cover other topics, from IT/sysadmin to gaming.
u/get_username · 2 pointsr/javahelp

For the purposes here I will basically define my terms I am using.

...

Alone will mean that there could be other methods, variables, etc that I am not accounting for. Basically it is saying "Below or above this is a snapshot of an interesting area.. there would be other code too!".

While

myMethod(...);

or

public void myMethod(...) {...}

Is saying "I don't know what you'd put there. It depends on what you decide" In the case of:

(...)

We are talking about unknown parameters passed to a method.

In the case of:

{...}

I am talking about an "unknown method body". Meaning I don't know what the logic would be (or am too lazy to type it out).

==
==
So a problem will certainly occur in GameView. Perhaps I was misleading you with what to do though. You have this line of code (198) in GameView.java

myGameView = new GameView(getContext());

That is will cause an infinite loop. Which means I may have not been clear earlier on how to use GameView correctly (because this is clearly a line of code I suggested).

Each time the "new" keyword is used its going to create a new instance of GameView. It does that by calling this method

public GameView(...) {...}

But inside that method is this statement:

myGameView = new GameView(getContext());

Which is going to call this method

public GameView(...) {...}

You can see the loop now and where the problem is happening.

This is probably the cause of your stack overflow. It will keep creating GameViews until the end of the universe.

Lets talk about how to fix it and where you should be using the new keyword.

==
==

About fixing your program to run.

If we look inside your GameThread.java class we see this line of code in the run() method.

GameView.myGameView.onUpdate();

You're trying to reference GameView as static still. This wasn't what I was trying to initially get at. Instead you should create a variable in the GameThread that stores the GameView as a new object and access that directly.

public class GameThread<MainGamePanel> extends Thread {
...
private GameView myGameView;

public GameThread(...) {
...
Context context = someMethodToGetContext();
this.myGameView = new GameView();
...
}

then in your run method you can call that object directly without static references etc.

public void run() {
...
// somewhere in the appropriate spot
myGameView.onUpdate();
...
}

This means you could remove all the static from all your fields and methods in GameView and instead use it as an object.

==
==

This part is simply about writing slightly better code :)

Also one more thing that would make your code easier to read and understand. I try to abide by uncle Bob's standards.

You should place your constructor as the first method in the class:

public class GameView extends... {
// class fields here

public GameView(..) {...}

// All other methods here.

You shouldn't include unnecessary comments like:

// Global Variables
// -------------------

Because we already know what they are. It is convention to put them at the top of a class.

Furthermore anytime you feel the need to do that inside of a method like:

// Draw Stars
// ---------------

This shouldn't be done. Instead you should create another "Helper" method that does that, named exactly what the comment would be named. This will help with readability and it will become easier to maintain since each function will do one specific thing.

protected void onDraw(Canvas canvas) {
drawStars();
drawAnyBullets();
}

is alot more clear and easy to read. Generally There is a rule. That is if you have more than 1 or 2 levels of indentation inside a method you are probably having it do more than one thing and should break it up into smaller methods (that will be easier to read, and more abstract thus easier to write).

Then we want our methods in our class to go from "most abstract" to "least abstract" in our class structure:

public class GameView extends... {
// class fields here

public GameView(..) {...}

public void onDraw(Canvas canvas) {
drawStars(...);
drawAnyBullets(...);
}

public void drawAnyBullets(...) {
drawPlayerBullets(...);
drawEnemyBullets(...);
}

public void onUpdate() {
if(touched) {
update();
}
}

public void update() {
renderBullets();
renderStars();
renderEnemies();
keepShipInBoundaries();
}

...

// Other methods past here include some logic, but still not full logic

public void drawPlayerBullets(...) {
ArrayList projectiles = PlayerShip.getProjectiles();
for (int i = 0; i < projectiles.size(); i++) {

LaserShot p = (LaserShot) projectiles.get(i);
Color color = Color.CYAN;
drawProjectile(p, color);

}
}

....

// Other methods past here include all logic, no other method calls for this class.


public void drawProjectile(LaserShot projectile, Color color) {
paint.setColor(color);

int coordStartX = projectile.getX();
int coordStartY = projectile.getY();
int coordEndX = coordStartY + laserlength;
int coordEndY = coordStartX + laserwidth;

canvas.drawRect(coordStartX, coordStartY, coordEndX, coordEndY);
}

...
}

From here in one fell swoop we eliminated a lot of redundancy. Now whenever you want to place a projectile you simply call the abstracted "drawProjectile" method. Never again worrying about the minute detail.

Want to change how a projectile draws? Don't have to change every line of code. Simply change drawProjectile.

The more you break up your code into logical chunks the more often you'll find yourself able to replace certain lines of code with previously written logic. The easier your life will become.

You'll have to decide where to place the methods. What the best break up of functionality is. What parameters to pass into the methods themselves, etc. But that is all part of learning to code.


This might have looked complicated but I think you have it in you.

In fact your comments show me is that you know how to break your methods apart in logical chunks. This is good and is probably better than most beginning programmers. Now take it to the next level and break out those logical chunks into their own methods!

u/javaxnerd · 2 pointsr/javahelp

> Effective Java - This has historically been an excellent reference for Java. It's not entirely beginner friendly, but if you have at least a working knowledge of Java it's an excellent book to have around. Note: The link is for the 3rd edition which is coming out soon, I assume it will be as good as the previous editions, but in any case the information from the previous editions is still worthwhile even if there are newer features in Java 7/8/9 which is covered by the 3rd edition

I agree with this. Since 3rd edition is only a month away now after years of not knowing if/when there would be another edition, I'd probably say pre-order it and hold out for 3rd. But yes, 2nd has been a great help to me.

u/MegaGreenLightning · 3 pointsr/javahelp

I've read both Effective Java and Clean Code and highly recommend them as well.

There's also Agile Software Development (by Robert C. Martin):
http://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445/ref=sr_1_1?ie=UTF8&qid=1451828712&sr=8-1&keywords=agile+software+development

This book contains among other things a description of the SOLID principles of software design. For example the Single Responsibility Principle tells you that each class should have only one responsibility. This reduces coupling and leads to small and more easily understandable classes. The book also contains some nice case studies showing how to apply these techniques.

While Clean Code deals with writing code and how to design methods and classes, Agile Software Development tackles the topic at a higher level and discusses how to develop and design software consisting of different classes and packages etc. It requires a basic knowledge of programming and OO, though.

Robert C. Martin has also created a series of purchasable training videos at cleancoders.com. These videos cover the topics of both books starting with the rules for clean code and then going into the SOLID principles and other advanced topics.

u/GlitteringSkeleton · 4 pointsr/javahelp

I'd start with this article. Finding newer versions of the books mentioned here is going to get you going on the right path. Here's a few I've picked out that I've personally read over the years.

Java: A Beginners Guide - Doesn't really get much better than this as far as an introduction into Java. Clean examples, pretty easy to follow. Would be a great place to start

Effective Java - This has historically been an excellent reference for Java. It's not entirely beginner friendly, but if you have at least a working knowledge of Java it's an excellent book to have around. Note: The link is for the 3rd edition which is coming out soon, I assume it will be as good as the previous editions, but in any case the information from the previous editions is still worthwhile even if there are newer features in Java 7/8/9 which is covered by the 3rd edition

Java Concurrency in Practice - As you become more advanced this book can help guide you along the ways of concurrent operations in Java and pitfalls/issues you'll run into (and how to avoid them)

u/kraftvgs · 5 pointsr/javahelp

For the love of god find someone else that teaches Java at a high school level. Go over their lesson plans with them. Figure out what types of things they are teaching through each unit. While reading Head First is a good introduction to programming Java, it isn't necessarily what you need to be teaching these kids at this point.

Is this a first programming class for most? Or is this a follow-up to an introductory class? There are a lot of variables that will influence the content and concepts that should be taught.

Finally, and please don't take offense to to this, but I find it crazy that they are having someone with NO experience in the position of introducing people to a field that can be simultaneously fun, frustrating, rewarding, difficult, etc. Again, please don't take offense, but you will not do a good job grading as you have no experience. You need time to practice identifying good and bad code yourself. For every problem out there you can probably devise hundreds of ways to successfully solve it, but only some of them will be elegant and (hopefully in a teacher's eyes) acceptable.

For the love of god take a programming class! Have someone look at code you are writing because there is no better way to learn than to do it yourself. Head Start is a decent point to learn Java. Also check out Clean Code as it will help you learn some fundamentals of what makes good code. Finally, get together with another teacher that has experience teaching this subject matter and leech as much as you can off of them. Software programming can be a fun and very lucrative career. I understand you are lazy but please don't sour kids on it or start them off on the wrong foot.

u/Pandarr · 1 pointr/javahelp

I just started reading Effective Java about 2 days ago and am already 1/3rd through it. Very good stuff even though I've been doing Java for a good 8 years or so. Depending on your level some of it might be over your head but you can skip a section and come back to it later. Knowing some good habits is better than knowing none! I also got the Java Puzzlers: Traps, Pitfalls, and Corner Cases book and man that's a tough book. It's very easy to read and understand but so far I haven't figured out any of the puzzles on my own although I'm only about 10 in. So far I can't imagine encountering any of these situations in the real world (or at least my office) but it's good to know and understand them because I'm sure at least one will eventually happen.

u/slowfly1st · 6 pointsr/javahelp

Since it's only a few weeks and you will use Java primarily, probably look primarily at the Java API's / components:

https://docs.oracle.com/javase/8/docs/index.html

(honestly can't find this overview page for newer versions java)

Collections-API is a good start (Map, List, Collection and so on and their implementations), I/O (read and write files), Concurrency/Multithreading (also understand the concepts), JDBC (connect to a database, read and write data). Date/Time-API. Probably networking.

Also learn all the language features. E.g. that there are three different kind of comments, know "all the keywords" (what's volatile and transient? I always mix them up ...), or what is try-with-resource?

If you're decent with java, you'll have,... let's say "one problem less"

​

Learn OOP/OOD: Read and understand those concepts is a good start: SOLID, Loose coupling, High cohesion, Information Hiding. Those concepts we do apply, so we can reuse parts of our code (so it's not duplicated), improve maintainability, interchangeability (like changing the front end technology to display the website without redoing the whole software), and so on. Not sure if that's too early for you, in the sense, that you are still learning the language and learning another "thing" is too much.

​

Databases are already mentioned (many applications use a relational database as 'backend'): Setup a database (e.g. postgreSQL or mysql, both are free), learn how to create tables (columns, datatypes, primary keys, [indices, constraints]), crud operations (create, read, update, delete data), how to restrict selection of data (where clause), how "to join tables", functions (max(), avg(), count()). Imo the basic concepts of 'relational databases' and how you get/change data is quite easy compared to learning a programming language.

​

Read Clean Code. (Probably too early for you, but I leave it here)

​

Probably have a look at HTML/CSS/JS. I really like w3schools, but mostly as a reference, because I don't know these by heart. Not sure if you have enough time, but try to learn some of the components of html and learn how to style them. It's actually quite easy compared to Java. If there's enough time, to learn some JavaScript may be helpful, too.

​

... and now combine everything :P - no, seriously: "Ship" a product - even if it's something small and irrelevant. To break down a problem into smaller problems and combine everything we know to solve those problems with the most elegant solution is what we do day in day out. And get your code reviews (e.g. here on reddit, the stackexchange-network has a good code review network, too). Because there's always a better and more elegant solution. If no one tells you, your code sucks (... or can be improved) and why, you keep writing bad code - or at least you won't improve as fast.

u/Bgomez89 · 1 pointr/javahelp

declaring a method as private/public does different things. A public method means that any class can access that method. A private method on the other hand cannot be accessed by any class except the one it's in.

You're pretty new to java and it's awesome that you're starting to build programs. Keep going! I'm a big fan of this text book: http://www.amazon.com/Java-How-Program-Edition-Deitel/dp/0132575663

It's a very easy to read and has lots of great explanations/problems

u/papers_ · 2 pointsr/javahelp

If you are already proficient in another language, then picking up a book on learning Java won't do you much in my opinion. It's been said once you learn a language, you can learn any language (something like that). The majority of the concepts are the same for the most part.

I think the best thing to do for learning is to port one of your Python programs to Java. Or quickly write something up, like implementing a BST from scratch then port it to Java. The biggest obstacle would be thinking Java. What may work amazing in Python may work like crap in Java.

If you want a book, then I recommend the Java 8 Pocket Guide. It'll help you out with those moments like "How do I read from a file?"

u/wildjokers · 2 pointsr/javahelp

If you are just learning game programming using a Timer for a game is OK. Here are the timer periods to use for various FPS:

u/Plussh · 1 pointr/javahelp

You should use classes to house methods based on relevancy and to generally make your program easier to understand.

I would say having 20 methods in your main class probably isnt best practice, but it really depends on what the functions are being used for.

Say if you were writing a program pertaining to cars, you would ideally have your main class launch the program and create instances of classes, and you could have a class called 'car' that handles all of the functions relating to the use of the car e.g openDoor(), doUpSeatBelt(). It wouldnt make sense to have these in your main class.

Classes are there to make your program easier for both you, and arguably more importantly other people to read, they also make it easier to re-use code and scale your programs.

There are tons of resources out there that explain this better than I can, see 'Java: the complete reference'.

https://www.amazon.co.uk/Java-Complete-Reference-Herbert-Schildt/dp/0071808558/ref=sr_1_10?ie=UTF8&qid=1518696204&sr=8-10&keywords=java

u/siphilis · 3 pointsr/javahelp

It sounds like you could really benefit from reading Clean Code. It isn't really about a specific design pattern, but an overall design philosophy. It gets mentioned in the programming subreddits all the time, and for good reason. I haven't finished it yet, but it's already had a big positive impact on the way I think about, and design my code.

u/L_Caret_Two · 1 pointr/javahelp

I'll definitely give that book a look. The reason I'm using this book is because it's the book for the class I'm taking. This is the book.

Thanks again for the extensive replies to this post. I really appreciate your help.

u/Sk0_756 · 2 pointsr/javahelp

Read /u/RankWeis's write-up for what a framework is, he gave a very good explanation.

I would personally suggest advancing by learning basic / common design patterns. Spring is a dependency injection framework at its core, and dependency injection is a design pattern you should know well before picking up Spring to really understand and use its full potential. It's one thing to pick up and use a framework, quite another to know why you're using that framework and what problems it's there to solve. I would also argue that design patterns are something you can take on any project, not limited by the chosen framework, so you would get more mileage out of knowing those before jumping into a specific framework.

I would highly recommend the Head First Design Patterns book. It's very well written and makes the common patterns very easy to digest. http://www.amazon.com/First-Design-Patterns-Elisabeth-Freeman/dp/0596007124

u/Vorzard · 1 pointr/javahelp

They should be considered only as pure functions and even then giving up polymorphism can lead to software components that cannot be easily changed and interchanged.

Static factory methods are useful and should be considered instead of constructors. You can learn more about that from Effective Java.

Otherwise static methods are unnatural in an object-oriented environment and they can considerably hinder testability.
Kotlin (a JVM language that aims to be a better Java) for example does not have static methods and variables for this reason, instead it has class objects. Instances of a class delegate to a shared, singleton object and the caller can invoke methods of that class object on any instance of the class as if they were static methods.

u/papichulo916 · 2 pointsr/javahelp

Building Java Programs: A back to basics approach is the one I'm using right now for my class. It is expensive ( you can get it for around $55 on amazon) but I find it easy to read and therefore easy to learn the stuff.

u/Yogi_DMT · 2 pointsr/javahelp

https://www.amazon.com/Java-Complete-Reference-Herbert-Schildt/dp/0071808558

The official reference was definitely the best resource for me. Even if you're a beginner, if you really want to learn Java it's the most well written and best explained book. If you want to learn how to print hello world to the console there are probably some books that could get you there quicker but if you want to understand the language and not have to relearn poorly explained concepts this is the one.

u/Loomax · 1 pointr/javahelp

There is going to be a lot of "Head First Java" recommendations and I suppose it is a decent entry if you are of a visual learning type (personally I can't get along with it).
Even tho you did say books, https://www.edx.org/ is there to learn if you want to.

My suggestion would be to start developing your own application (can be the most simple thing) and expand on it and use resources like stackoverflow and if you got a little bit of experience I really recommend reading Effective Java by Joshua Bloch.

That is (from those books I have read) the book that has gotten me the furthers in understanding what to look out for. Beside that I suggest to find some people that enjoy the same and talk about coding and share experience (this one is most likely the most important point, since you learn so much from others and them pointing out your wrong-doings).

In a list this would be:

  • Learn the basics of java (you say you got that)
  • Create your own project
  • code code code
  • talk to others about your code
  • redo (it's wrong anyway)
  • read up on how to improve on the design
  • read Effective Java
  • Keep on doing it
  • Last but really important: Keep notes of what wrong and why!
u/katyne · 1 pointr/javahelp

> I need to get a book or something

Head First Java - everything you needed to understand about Java's OOP concepts, explained like you're 5 :] literally.

Hint - there are older editions available online.. much cheaper, it really doesn't matter, you might as well get the oldest one because the things in this book are conceptual and are not changing with new versions of the language.

u/OffbeatDrizzle · 2 pointsr/javahelp

Yeah, or if not just play around on your own with it for a weekend, it's pretty simple to pick up.

Something else I'd add to that list is dependency injection (which again might be covered under MVC-frameworks if they tell you about Spring).

Also, this is a useful tool for getting to grips with design patterns, and I can't recommend this book enough

u/Razzal · 6 pointsr/javahelp

For a good beginner book that I think explains things well, look at Headfirst Java.

http://www.amazon.com/Head-First-Java-2nd-Edition/dp/0596009208

u/TheEffortless · 1 pointr/javahelp

You're welcome!
Here's the amazon preview link

u/morhp · 4 pointsr/javahelp

The Head First series is quite light and fun to read/work through. I'd suggest

https://www.amazon.com/Head-First-Java-Kathy-Sierra/dp/0596009208/ref=pd_sim_14_5?ie=UTF8&psc=1&refRID=7QHH9XZJAXDWPFKR32BP

followed by

https://www.amazon.com/Head-First-Design-Patterns-Freeman/dp/0596007124/ref=sr_1_1?s=books&ie=UTF8&qid=1472716617&sr=1-1

Honestly, not too sure if the first book is that great, as I haven't read it, but the look inside view looks quite good and the reviews aren't too bad. Maybe there are alternatives.

The second book I have read and would highly recommend. You need some basic beginner knowledge about objects and stuff first, though.

Edit: Also if you haven't done it yet, think about setting an IDE up for him (or let him do it himself). Nothing discourages more than having to mess with line numbers in compiler output logs, or get frustrated because you run the wrong class files and so on.

u/sh0rug0ru · 1 pointr/javahelp

Oh, I think I may have misunderstood the question.

On the question of whether or not you should create a method that is called from the constructor which does the actual construction of the GUI, in that case I would advocate the "Clean Code" principles.

The constructor for a GUI is probably going to be doing a bunch of different kinds of things: layout, event handling, model configuration, etc. I like the idea of having small and tight methods, that are responsible for one of each of these areas of responsibility, which are called one by one from the constructor.

For this, I'm a very big fan of the "extract method" refactoring.

u/hadihaha · 1 pointr/javahelp

My experience with Java textbooks is the sum total of two, but i did like Head First into Java.

u/sunlollyking · 2 pointsr/javahelp

Joshua Bloch's essential Java is pretty widely available http://www.amazon.co.uk/Effective-Java-Edition-Joshua-Bloch/dp/0321356683

Its still considered the go to book when talking about concurrency and multithreading, i read it in University and found it a bit heavy going but it is highly insightful and Bloch is very knowledgeable on the subject.

u/Yithar · 1 pointr/javahelp

https://www.amazon.com/Functional-Programming-Java-Harnessing-Expressions/dp/1937785467
https://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601

First book deals with Functional Programming in Java, which is another way of doing things compared to the Object-Oriented Paradigm.

Second book deals with Concurrency, which is a really important topic imo.

u/ryosen · 2 pointsr/javahelp

Java is a great language to start out with and I would recommend two books to get you running. Since you are new to the language and programming in general, start with Head First Java. Then, move on to a more advanced treatment like Core Java. Thinking in Java is also very good but it's dense and some people have a difficult time digesting it.

Once you have the basics of the language down, learn about working with databases. Then, move on to server-side development as that's where the jobs are.

Despite the similarity of their names, Java and JavaScript are not similar and cannot be used interchangeably. JavaScript is primarily used in UI development in web browsers, although server-side implementations have existed for almost as long as JavaScript itself. Currently, the most fashionable of these implementations is node.js.

Lastly, since you are looking to work professionally but without any formal education, know that you are going to have a difficult time getting work for the first several years. You might find that learning JavaScript (and HTML and CSS) are a quicker route to finding a job as front-end web developers often do not require a college degree, whereas Java programming jobs invariably do.

u/oorza · 2 pointsr/javahelp

Read, in this order:

  1. Thinking In Java.

  2. Effective Java

  3. Java Concurrency in Practice

    Those three books should get you wherever you need to be, without getting more specific books (e.g. framework books).
u/ewiethoff · 1 pointr/javahelp

Effective Java by Josh Bloch will eliminate bad habits.

Also, have you done some of Oracle's tutorials? Once you get through "Trails Covering the Basics" (which will be a lot of review for you anyway), you can pick and choose which tutorials interest you.