The document contains Java programming examples that demonstrate how to take user input and perform calculations, such as displaying the square and cube of a number. It includes code snippets for reading integers, checking for odd or even numbers, and generating multiplication tables. The examples illustrate basic Java syntax and the use of the Scanner class for input handling.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
30 views6 pages
Java Assignment 2
The document contains Java programming examples that demonstrate how to take user input and perform calculations, such as displaying the square and cube of a number. It includes code snippets for reading integers, checking for odd or even numbers, and generating multiplication tables. The examples illustrate basic Java syntax and the use of the Scanner class for input handling.