- #1
nextint()
or nextdouble()
in the Scanner
class. It's nextInt()
and nextDouble()
. Note the capitals. These follow from the Java function naming conventions.sc
(small letters) is better than Sc
. In addition, when you are taking input, you can use System.out.print(...)
instead of System.out.println(...)
. The last one is just for aesthetics, though.Please repost your thread using the instructions from @Wrichik Basu -- You really need to post the code within code tags if you want to get help at PF with your code. Please also tell us what you think is wrong with the code; are you getting errors?grzz said:TL;DR Summary: I need help because I cannot find mistakes in my java program.
Please help me to find what my mistakes are in the following java program.
Java is a popular programming language that is used to create software applications and websites. It is a high-level, object-oriented language that is designed to be platform-independent, meaning that it can run on any operating system without needing to be rewritten. Java is used in a wide range of applications, from mobile apps to enterprise software.
There are many resources available for learning Java programming, including online tutorials, books, and courses. It is recommended to start with the basics of programming, such as understanding variables, data types, and control structures, before moving on to more advanced concepts. It is also helpful to practice writing and debugging code on your own, as this will help you gain a deeper understanding of the language.
Some key concepts in Java programming include objects and classes, which are used to create reusable code and organize data. Java is also known for its use of inheritance, polymorphism, and encapsulation, which allow for efficient and flexible code. Additionally, Java uses a virtual machine to run programs, which helps with its platform-independence.
Some common challenges for beginners in Java programming include understanding the syntax and structure of the language, debugging errors in code, and understanding more advanced concepts such as object-oriented programming. It is important to be patient and practice regularly in order to overcome these challenges.
One of the best ways to improve your skills in Java programming is to practice regularly and challenge yourself with new projects. You can also read books and articles on advanced topics, attend workshops and conferences, and collaborate with other programmers. It is also helpful to constantly review and refactor your code to improve its efficiency and readability.