Computer Science, asked by prateeksingh0203, 4 months ago

write a program in java to print the multiplication of the two value by assigning the following values
A=4;B=3​

Answers

Answered by itzcottoncandysneha
1

10.  Arrays

10.1  Array Index

10.2  Array's length

10.3  Array and Loop

10.4  Enhanced for-loop (or "for-each" Loop) (JDK 5)

10.5  Code Example: Read and Print Array

10.6  Code Example: Horizontal and Vertical Histograms

10.7  Code Example: Hexadecimal to Binary (Hex2Bin)

10.8  Code Example: Decimal to Hexadecimal (Dec2Hex)

10.9  Exercises on Arrays

10.10  Multi-Dimensional Array

11.  Methods (Functions)

11.1  Why Methods?

11.2  Using Methods

11.3  The "return" statement

11.4  The "void" Return-Type

11.5  Actual Parameters vs. Formal Parameters

11.6  Code Example: Magic Number

11.7  Code Example: int Array Methods

11.8  Pass-by-Value for Primitive-Type Parameters

11.9  Pass-by-Reference for Arrays and Objects

11.10  Varargs - Method with Variable Number of Formal Arguments (JDK 5)

11.11  Implicit Type-Casting for Method's Parameters

11.12  Method Overloading

11.13  "boolean" Methods

11.14  Mathematical Methods

11.15  Exercises on Methods

12.  Command-Line Arguments

12.1  Code Example: Arithmetic

12.2  Exercises on Command-Line Arguments

13.  (Advanced) Bitwise Operations

13.1  Bitwise Logical Operations

13.2  Bit-Shift Operations

13.3  Types and Bitwise Operations

14.  Algorithms

14.1  Algorithm for Prime Testing

14.2  Algorithm for Perfect Numbers

14.3  Algorithm on Computing Greatest Common Divisor (GCD)

14.4  Exercises on Algorithm

15.  Summary

Java Programming Tutorial

Java Basics

This chapter explains the basic syntaxes of the Java programming language. I shall assume that you have written some simple Java programs. Otherwise, read "Introduction To Java Programming for First-time Programmers".

To be proficient in a programming language, you need to master two things:

The syntax of the programming language: Not too difficult to learn a small set of keywords and syntaxes. For examples, JDK 1.8 has 48 keywords; C11 has 44, and C++11 has 73.

The Application Program Interface (API) libraries associated with the language: You don’t want to write everything from scratch yourself. Instead, you can re-use the available code in the library. Learning library could be difficult as it is really huge, evolving and could take on its own life as another programming language.

The first few sections are a bit boring, as I have to explain the basic concepts with some details.

You may also try the "Exercises on Java Basics".

1.  Basic Syntaxes

1.1  Steps in Writing a Java Program

The steps in writing a Java program is illustrated as follows:

Step 1: Write the source code Xxx.java using a programming text editor (such as Sublime Text, Atom, Notepad++, Textpad, gEdit) or an IDE(such as Eclipse or NetBeans).

Step 2: Compile the source code Xxx.java into Java portable bytecode Xxx.class using the JDK Compiler by issuing command:

javac Xxx.java

Step 3: Run the compiled bytecode Xxx.class with the input to produce the desired output, using the Java Runtime by issuing command:

Similar questions
Math, 2 months ago