I can assure you that the length of the solution and the algorithms used make it seem more complicated than it really is... When you boil it down, you’re basically just getting two binary numbers from the user, adding them together (one bit at a time until you’ve added everything), and then printing the result. My suggestion would be to start by practicing binary addition on paper. I find it significantly easier than trying to “calculate it” in a program, mostly because the + operator doesn’t work with binary the same way it works with decimals. Once you feel like you can easily add binary numbers on paper, take a look at the code inside of that “while” loop again. Make sure you understand what the modulo (%) operator is doing, and why we need a remainder... The (binary % 10) section divides the number by 10 and gives you the remainder... All this is doing is getting the FIRST digit in the number. Think about it: 10101 divided by 10 gives you a remainder of 1, right? So what you’re really doing is just adding the first digits of the two binary numbers together, saving the result as the first digit of your “sum”, checking if there was a remainder, and (if there was) carrying it over to the next digit... Think of it like adding 19 and 17: When you add the first two digits (9 and 7) you get 16, so you put 6 as the first digit of your sum and carry the 10 over to the next position. Anyway, I might not be an expert, but I really do suggest mastering binary addition on paper and then making a program that solves it essentially the same way you do it on paper. Good luck! Answer from Onikai32 on reddit.com
🌐
w3resource
w3resource.com › java-exercises
Java programming Exercises, Practice, Solution - w3resource
This resource offers a total of 5356 Java Programming problems for practice.
🌐
W3Schools
w3schools.com › java › java_exercises.asp
Java Exercises
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
🌐
W3Resource
w3resource.com › java-tutorial › index.php › 1000
Java Tutorial - w3resource
Java Tutorial for Beginners - This is the first article of w3resource's Java programming tutorial. The aim of this tutorial is to make beginners conversant with Java programming language.
Discussions

Practice programming Java
MOOC.FI Java Programming 1 and Java Programming 2 is a good course to learn Java because it has practice assignments that you turn in for a grade that will be auto graded-> https://java-programming.mooc.fi/part-1 You can find a project/or exercise to code You can get a book such as "Starting out with Programming logic & Design" that has programming exercises in them More on reddit.com
🌐 r/learnprogramming
8
3
March 17, 2024
How Would I Ever Know...?
I can assure you that the length of the solution and the algorithms used make it seem more complicated than it really is... When you boil it down, you’re basically just getting two binary numbers from the user, adding them together (one bit at a time until you’ve added everything), and then printing the result. My suggestion would be to start by practicing binary addition on paper. I find it significantly easier than trying to “calculate it” in a program, mostly because the + operator doesn’t work with binary the same way it works with decimals. Once you feel like you can easily add binary numbers on paper, take a look at the code inside of that “while” loop again. Make sure you understand what the modulo (%) operator is doing, and why we need a remainder... The (binary % 10) section divides the number by 10 and gives you the remainder... All this is doing is getting the FIRST digit in the number. Think about it: 10101 divided by 10 gives you a remainder of 1, right? So what you’re really doing is just adding the first digits of the two binary numbers together, saving the result as the first digit of your “sum”, checking if there was a remainder, and (if there was) carrying it over to the next digit... Think of it like adding 19 and 17: When you add the first two digits (9 and 7) you get 16, so you put 6 as the first digit of your sum and carry the 10 over to the next position. Anyway, I might not be an expert, but I really do suggest mastering binary addition on paper and then making a program that solves it essentially the same way you do it on paper. Good luck! More on reddit.com
🌐 r/learnjava
3
6
November 22, 2017
Trying to find something for Java practice
W3resource has more than 200 java practices More on reddit.com
🌐 r/learnjava
4
6
December 5, 2023
Watching Java tutorials and following along on my IDE but it seems ineffective?
I would recommend doing Mosh Hamedani's Java course (and later on his DS & Algorithms course). In parallel do exercises which you can find online (w3resource, hacker rank etc). More on reddit.com
🌐 r/learnprogramming
December 13, 2021
🌐
Reddit
reddit.com › r/learnprogramming › practice programming java
r/learnprogramming on Reddit: Practice programming Java
March 17, 2024 -

Is there a way that I’m able to practice Java programming so that I can be able to retain the information that I’m learning about Java? I’m still new to learning Java SE 11 and I want to be able to practice while on my off time of not taking my online class.

Top answer
1 of 5
5
MOOC.FI Java Programming 1 and Java Programming 2 is a good course to learn Java because it has practice assignments that you turn in for a grade that will be auto graded-> https://java-programming.mooc.fi/part-1 You can find a project/or exercise to code You can get a book such as "Starting out with Programming logic & Design" that has programming exercises in them
2 of 5
2
I think one of the best ways is to come up with simple programs that will serve a purpose at the end and try and implement the stuff that you've learned in order to achieve your goal. As an example lets say you've learning about arrays and data structures. I would try and create a program that would organize movie titles based on certain aspects of the film. So film title, year released, main actor / actress etc... This will get you thinking about what it is you want to accomplish as well as how you can go about solving the issue. To make things a bit more complicated, if you have covered Swing and UI components then you can also add that in as well, and then put all of the movie information into a table and try and sort them by column title. Just an idea, as these types of self exercises helped me a lot as I sometimes ran into issues that I didn't quite understand how to deal with, but with a bit a research and additional learning, I was able to work them out. Also these "issues" that you'll run into are usually situations that are not taught in lessons online or in a book, but yet serve as real world examples of what developers need to do in order to find ways to make the code work. I hope this helps and that I haven't provided more confusion to your question. Cheers,
🌐
W3Resource
w3resource.com › java-tutorial › java-packages.php
Java Packages - w3resource
To place a Java class in a certain package, add the package statement at the beginning of the class (it must be the first non-comment statement in the class).For example, if the class SalesTax has been developed for the Accounting department, you can declare it as follows, which will result in creation of directory structure as below:
🌐
W3Resource
w3resource.com › quizzes › java › index.php
Java Quizzes - w3resource
August 19, 2022 - Java online Quizzes: Test your Java skills on Java.
🌐
Reddit
reddit.com › r/learnjava › how would i ever know...?
r/learnjava on Reddit: How Would I Ever Know...?
November 22, 2017 -

https://www.w3resource.com/java-exercises/basic/java-basic-exercise-17.php

https://www.w3resource.com/java-exercises/basic/java-basic-exercise-18.php

I've been trying to do some practice here and there, since just reading Head First and doing EdX isn't enough. However, running into problems like this have me wondering...

How in the hell would I ever figure out solutions like this? Is it from practice? Should I learn algorithms first? I'm just surprised that this is in the "Basic" exercises. I feel dumb...

Top answer
1 of 2
3
I can assure you that the length of the solution and the algorithms used make it seem more complicated than it really is... When you boil it down, you’re basically just getting two binary numbers from the user, adding them together (one bit at a time until you’ve added everything), and then printing the result. My suggestion would be to start by practicing binary addition on paper. I find it significantly easier than trying to “calculate it” in a program, mostly because the + operator doesn’t work with binary the same way it works with decimals. Once you feel like you can easily add binary numbers on paper, take a look at the code inside of that “while” loop again. Make sure you understand what the modulo (%) operator is doing, and why we need a remainder... The (binary % 10) section divides the number by 10 and gives you the remainder... All this is doing is getting the FIRST digit in the number. Think about it: 10101 divided by 10 gives you a remainder of 1, right? So what you’re really doing is just adding the first digits of the two binary numbers together, saving the result as the first digit of your “sum”, checking if there was a remainder, and (if there was) carrying it over to the next digit... Think of it like adding 19 and 17: When you add the first two digits (9 and 7) you get 16, so you put 6 as the first digit of your sum and carry the 10 over to the next position. Anyway, I might not be an expert, but I really do suggest mastering binary addition on paper and then making a program that solves it essentially the same way you do it on paper. Good luck!
2 of 2
1
You know, I've been a software developer professionally now for the better half of a decade, and looking at those exercises, I couldn't tell you the first thing about solving it. Just the fact that it's basic Java... And uses binaries to calculate things for examples... Personally I'd say it's a failure on the writer of the exercise, that they assume higher level knowledge of some other field, that isn't necessary or even overly useful, for the topic it's trying to teach. There is no need for you to understand how binary numbers work, to learn to code. On a sidenote, I started "getting it" when I ran through the entirety of CodingBat . Not saying it'll be for you, but give it a try. It has way less binary, and a lot more "code". And for people like me, who just move on thinking I know something, it's very helpful in that it forces you to do things over and over, with slight variations.
🌐
w3resource
w3resource.com.cach3.com › java-exercises › basic › index1.php.html
Java Basic Programming Exercises - Part II- w3resource
July 11, 2022 - Practice with solution of exercises on Java basic: examples on variables, date, operator, input, output and more from w3resource.
Find elsewhere
🌐
Reddit
reddit.com › r/learnjava › trying to find something for java practice
r/learnjava on Reddit: Trying to find something for Java practice
December 5, 2023 -

Hello, java community, 6 months ago, I started learning some algorithms and beginner level code in C (I'm studying CS and our school started with C) and I got to the functions. Now my school has switched to Java and I am trying to learn Java and I can do simple practices. While learning C, I used the book "C programming a modern Approach by K.N. King" and the practices in it helped me a lot. I am looking for a java book similar to this book where I can practice java. Many people on the internet recommended the book "Head first Java", but it seemed a bit too childish to me (Frankly, I didn't look at it in detail). Do you think I should give the book "Head First Java" another chance or is there another book you can recommend to me where I can practice Java?

Top answer
1 of 4
2
W3resource has more than 200 java practices
2 of 4
1
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full - best also formatted as code block You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
🌐
W3Resource
w3resource.com
web development tutorials from w3resource
JavaScript Python Bash React.js PHP C Programming Language REST APIs R C++ SQL HTML Java JSON NoSQL Scala Django jQuery Kotlin Node.js Ruby on Rails C# .NET Framework Go Front-end Development Objective-C Git Object-Oriented Programming Eclipse
🌐
W3Resource
w3resource.com › java-tutorial › java-for-loop.php
Java For Loop - w3resource
A for loop is a special loop that is used when a definite number of loop iterations is required. Although a while loop can also be used to meet this requirement, the for loop provides you with a shorthand notation for this type of loop.
🌐
W3Resource
w3resource.com › quizzes › java › java-part-1.php
Java Quizzes: Java Part-I - w3resource
Java Quizzes: Test your Java skills with w3resource' quiz. This page contains interesting quizzes related to Java. The test contains 25 questions with no time limit. You will have to read all the given questions, answers and click over the correct answer.
🌐
Scribd
scribd.com › document › 721304876 › Java-Data-Types-exercises-Basic-Data-Types-Exercises-w3resource
Java Data Types Exercises Basic Data Types Exercises - W3resource | PDF | Technology & Engineering
Java Data Types exercises Basic Data Types Exercises - w3resource - Free download as PDF File (.pdf), Text File (.txt) or read online for free. The document discusses the benefits of genetic testing and how Genera can provide information about DNA predispositions through their tests.
🌐
W3Schools
w3schools.com › Html
W3Schools.com
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
🌐
W3Resource
w3resource.com › java-tutorial › java-program-structure.php
Java Program Structure - w3resource
August 19, 2022 - Output of above CarTest java class is as below. We can run CarTest java program because it has main method. Main method is starting point for any java program execution. Running a program means telling the Java VIrtual Machine (JVM) to "Load theclass, then start executing its main () method.
🌐
W3Resource
w3resource.com › java-tutorial › compiling-running-and-debugging-java-programs.php
Compiling, running and debugging Java programs - w3resource
It started as an IDE for developing Java programs but now it has different flavors for various programming languages like PHP, Spring, Scala etc.