FreeDomain
Free domain registration and practical DNS learning resources for everyone.
- 209k
- Markdown
- AGPL-3.0
- 3 mo ago
java (OOP) documentation with [learnwithfair, Learn with fair, Rahatul Rabbi, Md Rahatul Rabbi ,rahatulrabbi]
Repo learnwithfair/java-documentation, read from GitHub 1 min ago. learnwithfair has not joined Take My Repo.
learnwithfair/java-documentation is a public repo on GitHub by learnwithfair. java (OOP) documentation with [learnwithfair, Learn with fair, Rahatul Rabbi, Md Rahatul Rabbi ,rahatulrabbi]. It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it. It has 3 stars and last changed on 2024-05-03. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-21.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
Thanks for visiting my GitHub account!
Java is a popular OOP language. It is used to develop mobile apps, web apps, desktop apps, games, and much more. See More
| Features |
![]() |
![]() |
Intermediate
All assignments
This section explains how to compile and run a JAVA application from the command line. For information on compiling and running a JAVA application using NetBeans IDE, see Running Tutorial Examples in NetBeans IDE. Here are the steps you need to follow:
- Note: File name and class name must be the same.
--- To set java path ---
C:\Program Files\Java\jdk-21\bin)java -version Or, javac -versionOperators
Control statement
conditional control statement: if, else if, else, switch
Loop control statement: for, while, do while
Jump control statement: break, continue, return
Data structure
String
Date & Time
| Primary |
![]() |
| Advances |
![]() |
| JDBC, Socket, Thread |
![]() |
What is Java?
Why Should we learn Java / Features of Java?
What does platform independent means?
History of Java
Environment Setup
JDK: Java Development Kit is a software development environment used for developinh java applications and applets. It includes Java Runtimne Environment (JRE), an interpreter / loader (java), a compiler (javac), a document generator (javadoc) and other toold needed in java development. Check JDK is installed or not by using this command java -version in your terminal

IDE: Integrated Development Environment. An Integrated Development Environment (IDE) is a software application that provides comprehensive tools and features to facilitate software development. Examples of IDE's: Eclipse, NetBeans, Visual Studio Code, JDeveloper, IntelliJ IDEA, Programiz Java Compiler. Here are some reasons why developers use IDEs:
Code Editing: IDEs offer advanced code editing capabilities such as syntax highlighting, code completion, and error checking. These features help developers write code more efficiently and with fewer mistakes.
Debugging: IDEs provide debugging tools that allow developers to step through their code, set breakpoints, and inspect variables. Debugging tools help identify and fix issues in the code during development.
Build and Compilation: IDEs integrate with build systems and compilers, making it easier to build, compile, and run the code. They can automate repetitive tasks such as compiling, packaging, and deploying the application.
Project Management: IDEs provide project management features that help organize and manage code files, libraries, and resources. They offer features like code navigation, search, and refactoring tools, making it easier to work with large codebases.
Version Control Integration: IDEs often have built-in support for version control systems like Git. They provide features to commit, update, and manage code changes, making collaboration with other developers smoother.
Code Templates and Snippets: IDEs offer code templates and snippets that help speed up development by providing predefined code structures or commonly used code snippets.
Testing and Profiling: IDEs may include tools for writing and running tests, as well as performance profiling to identify bottlenecks in the code and optimize performance.
Integration with Frameworks and Libraries: Many IDEs provide integration with popular frameworks and libraries, offering features like code generation, automated configuration, and easy access to documentation.
// A program to print your info // Understand the program flow // keywords in Java - Keywords are reserved words and also in small letters // How to create a class, function // How to print in Java - use System.out.Println() or print() // what is string? printing string in quotation // printing numeric value does not require double quotation class Program1 { public static void main(String[] args) { System.out.print("Product Infos"); System.out.println("Product: iphone 14"); System.out.println("Price: $1300"); System.out.println("Quantity: 14"); } }
// Escape sequence - a special character followed by backslash. sometimes it is called as backshalsh character // example -> \b, \t, \n, \", \', \\ class Test { public static void main(String[] args) { System.out.print("\"Product Infos\"\n"); System.out.println("Product:\t iphone 14"); System.out.println("Price:\t\t $1300"); System.out.println("Quantity:\t 14"); } }
Comments are used to add explanatory notes or annotations within the source code. It is good practice to add meaningful comments to your code to enhance its understandability and maintainability. Comments can help you and other developers understand the purpose of the code, clarify complex logic, or provide reminders for future modifications. Java supports three types of comments:
//) and extend to the end of the line. They are used for short comments or explanations on a single line.// This is a single-line comment int age = 25; // Variable representing the age
/*) and end with an asterisk followed by a forward slash (*/). They can span multiple lines and are often used for longer explanations or comment blocks./* This is a multi-line comment It can span multiple lines Used for longer explanations or comment blocks */
/**) and end with an asterisk followed by a forward slash (*/). Javadoc comments are used to describe classes, methods, and fields and can include tags for specifying parameters, return values, exceptions, and more./** * This is a Javadoc comment. * It can be used to generate documentation. * @param name the name of the person * @return a greeting message */ public String greet(String name) { return "Hello, " + name + "!"; }
Variable Names:
Initialization:
Scope:
Constants:
final keyword to indicate that their value cannot be changed.Naming Conventions:
Declaration and Assignment:
Here's an example that illustrates these rules:
class Test { public static void main(String[] args) { String productName = "iphone 14"; double productPrice = 1300; int productQuantity = 14; final double PRODUCT_DISCOUNT = 10.133; System.out.println("Product Infos"); System.out.println("Product: " + productName); System.out.println("Price: $" + productPrice); System.out.println("Quantity: " + productQuantity); System.out.println("Discount: " + PRODUCT_DISCOUNT); } } /* * Learning outcomes * variable declaration * variable initalization * dynamic initialization * data types */ public class Program4 { public static void main(String[] args) { // declaring variables for a student String name; int id, age; double gpa; boolean isRegisted; // initializing variables for a student name = "Anisul Islam"; id = 1302020017; age = 25; gpa = 3.92; isRegisted = true; // printing variables System.out.println("Student Information"); System.out.println("--------------------"); System.out.println("Name: "+name); System.out.println("ID: "+id); System.out.println("Age: "+age); System.out.println("GPA: "+gpa); System.out.println("Registered: "+isRegisted); } }
By following these rules and conventions, you can write clean, readable, and maintainable code in Java.
/* * Assignment-2 (Variable and Data type) * step 1: create a class called Product * step 2: create a main method * step 3: declare variables: id, title, price, description, category * step 4: assign the following data in main method 101,iphone15,1895 euros,perfect product with best image quality, phone, * step 5: print the data */
/* * Learning outcomes * format specifiers */ public class Program5 { public static void main(String[] args) { // declaring variables for a student String name; int id, age; double gpa; boolean isRegisted; // initializing variables for a student name = "Anisul Islam"; id = 1302020017; age = 25; gpa = 3.92; isRegisted = true; // printing variables System.out.println("Student Information"); System.out.println("--------------------"); System.out.printf("Name: "+name); System.out.printf("Name: %s\n",name); System.out.printf("ID : %d: \n",id); System.out.printf("Age: %d\n",age); System.out.printf("GPA: %.2f\n",gpa); System.out.printf("Registered: %b\n",isRegisted); } }
import java.util.Scanner; class Test { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { // String productName = input.next(); // does not count anything after space System.out.print("Enter Product Name: "); String productName = input.nextLine(); System.out.print("Enter Product Price: "); double productPrice = input.nextDouble(); System.out.print("Enter Product Quantity: "); int productQuantity = input.nextInt(); final double PRODUCT_DISCOUNT = 10.133; System.out.println("Product Infos"); System.out.println("Product: " + productName); System.out.println("Price: $" + productPrice); System.out.println("Quantity: " + productQuantity); System.out.println("Discount: " + PRODUCT_DISCOUNT); } } } /* Learning outcome how to get user input Read a byte - nextByte() Read a short - nextShort() Read an int - nextInt() Read a long - nextLong() Read a float - nextFloat() Read a double - nextDouble() Read a boolean - nextBoolean() Read a complete line - nextLine() Read a word - next() */ import java.util.Scanner; public class Program6 { public static void main(String[] args) { Scanner input = new Scanner(System.in); // declaring variables for a student String name; int id, age; double gpa; boolean isRegisted; // getting inputs for a student System.out.print("Enter student name: "); name = input.nextLine(); System.out.print("Enter student id: "); id = input.nextInt(); System.out.print("Enter student age: "); age = input.nextInt(); System.out.print("Enter student gpa: "); gpa = input.nextDouble(); System.out.print("Enter student is isregistered? true/false : "); isRegisted = input.nextBoolean(); // printing variables System.out.println("Student Information"); System.out.println("--------------------"); System.out.println("Name: "+name); System.out.println("ID: "+id); System.out.println("Age: "+age); System.out.println("GPA: "+gpa); System.out.println("Registered: "+isRegisted); } }
/* * Assignment-3 (User Input) * step 1: create a class called Product * step 2: create a main method * step 3: declare variables: id, title, price, description, category * step 4: get user input for each variables * step 5: print the variables */
Arithmetic Operators:
+-*/%++--// Example of Arithmetic operators import java.util.Scanner; public class Program7 { public static void main(String[] args) { int number1, number2, result; Scanner input = new Scanner(System.in); System.out.print("number1 = "); number1 = input.nextInt(); System.out.print("number2 = "); number2 = input.nextInt(); result = number1 + number2; System.out.println(number1 +" + "+number2 + " = "+result); result = number1 - number2; System.out.println(number1 +" - "+number2 + " = "+result); result = number1 * number2; System.out.println(number1 +" * "+number2 + " = "+result); // type casting double result2 = (double)number1 / number2; System.out.println(number1 +" / "+number2 + " = "+result2); result = number1 % number2; System.out.println(number1 +" % "+number2 + " = "+result); } }
// Example of Unary Operators /* * Unary Operator * Unary Plus, minus * increment -> prefix increment, postfix increment * decrement -> prefix decrement, postfix decrement */ public class Program10 { public static void main(String[] args) { int x = 10; System.out.println(+x); System.out.println(-x); System.out.println(x++); System.out.println(++x); System.out.println(x); System.out.println(x--); System.out.println(--x); } }
Assignment Operators:
=+=-=*=/=%=// Example of Assignment operators public class Program8 { public static void main(String[] args) { int x = 10; x += 1; System.out.println("x = "+x); x -= 1; System.out.println("x = "+x); x *= 1; System.out.println("x = "+x); x /= 1; System.out.println("x = "+x); x %= 1; System.out.println("x = "+x); } }
Comparison Operators:
==!=><>=<=Logical Operators:
&&||!Bitwise Operators:
&|^~<<>>>>> // Example of bitwise operatorsConditional (Ternary) Operator:
?:) is used to assign a value based on a condition. It has the form condition ? expression1 : expression2. If the condition is true, expression1 is evaluated and assigned; otherwise, expression2 is evaluated and assigned.// ternary/conditional operator exp1 ? exp2 : exp3 public class Program16 { public static void main(String[] args) { int number = 20; String result = number%2==0 ? "even" : "odd"; System.out.println(result); } }
Instanceof Operator:
object instanceof type.Other Operators:
.): Used to access members of a class or object.,): Used to separate expressions in a statement.()): Used to group expressions and specify evaluation order.[]): Used for array indexing.new keyword.import java.util.Scanner; // Create a program to calculate installment amount for per month public class Assignment4 { public static void main(String[] args) { (Scanner input = new Scanner(System.in)) { int phonePrice = 1800; // 1800 euros int numberOfInstallment, installmentPerMonth; System.out.print("Number of installments? "); // get number of installments from user // calculate installment amount for per month System.out.println("Monthly installment Amount: "+installmentPerMonth + " euros"); } } }
// Area of Triangle Program import java.util.Scanner; public class Program9 { public static void main(String[] args) { double base, height, area; Scanner input = new Scanner(System.in); System.out.print("Enter Base = "); base = input.nextInt(); System.out.print("Enter Height = "); height = input.nextInt(); area = 0.5 * base * height; System.out.println("Area of Triangle = "+area); } }
// Temperature convert // F = 9/5 C + 32 import java.util.Scanner; class Test { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter Celsisu : "); double celsius = input.nextDouble(); double fahrenheit = 9 / 5.0 * celsius + 32; System.out.println("Fahrenheit: " + fahrenheit); } } }
if Statement: It executes a block of code if a certain condition is true.
if-else Statement: It executes one block of code if the condition is true and another block if the condition is false.
if-else-if Ladder: It allows multiple conditions to be checked one after another, and the corresponding block of code is executed based on the first condition that evaluates to true.
switch Statement: It checks a variable against multiple possible values and executes the code block associated with the matching value.
Positive, Negative Program - if, else if, else
// Positive, Negative Program - if, else if, else public class Program12 { public static void main(String[] args) { int number = 12; if(number>0){ System.out.println("Positive"); }else if(number<0){ System.out.println("Negative"); }else{ System.out.println("Zero"); } } }
Switch: Day of week
// Switch: Day of week public class Program12 { public static void main(String[] args) { int dayOfWeek = 3; switch (dayOfWeek) { case 1: System.out.println("Monday"); break; case 2: System.out.println("Tuesday"); break; case 3: System.out.println("Wednesday"); break; default: System.out.println("Unknown day"); } } }
// vowel or consonant program import java.util.Scanner; public class Program13 { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter a letter: "); char ch = input.next().charAt(0); if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') { System.out.println("Vowel"); } else { System.out.println("Consonant"); } } } }
// small /capital letter import java.util.Scanner; public class Program14 { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter a letter: "); char ch = input.next().charAt(0); if (ch >= 'a' && ch <= 'z') { System.out.println("Small letter"); } else if (ch >= 'A' && ch <= 'Z') { System.out.println("Capital letter"); } else { System.out.println("Not a letter"); } } } }
/* * valid voter program using if,else * step 1: ask for a person age * step 2: if age is equal or more than 18 than print valid voter * step 3: else print invalid voter */ public class Assignment5 { public static void main(String[] args) { } }
/* * Digit spelling program using if,else if, else * step 1: ask for a digit between 0-9 * step 2: check the digit and print it by spelling. example if user input is 0 then print Zero * step 3: if the digit is not among 0-9 then print Invalid digit */ public class Assignment6 { public static void main(String[] args) { } }
// Logical or assignment // step 1: Print "Do you love java? " // step 2: take user input y / Y / n / N // step 3: if user input y / Y then print you are a java lover // step 4: if user input n / N then print you are not a java lover public class Assignment7 { public static void main(String[] args) { } }
// Logical AND assignment // Check eligible candidate // Step 1: Ask the candidate have you completed your masters? y/n // Step 2: Ask the candidate are you fulent in English? y/n // Step 3: if the candidate has passed masters and also have fluent english skill then print you are eligible to for the job interview // Step 4: else print Sorry. you are not eligible to for the job interview public class Assignment8 { public static void main(String[] args) { } }
// switch assignment: call center // if user select option 1 then set language bengali // if user select option 2 then set language hindi // if user select option 3 then set language urdu // for any other option set language english public class Assignment9 { public static void main(String[] args) { // get the OPTION from user // use switch, case, break and default // Selected language is Bengali // Selected language is Hindi // Selected language is Urdu // Selected language is English } }
while Loop: It repeatedly executes a block of code as long as a condition is true.
do-while Loop: It executes a block of code at least once and then repeatedly executes it as long as a condition is true.
for Loop: It allows you to specify the initialization, condition, and iteration in a single line and repeatedly executes a block of code based on the condition.
for-each Loop: It is used to iterate over elements of an array or a collection.
// print 1-10 using loop control statements System.out.println("Using for loop:"); for (int i = 1; i <= 10; i++) { System.out.println(i); } System.out.println("Using while loop:"); int i = 1; while (i <= 10) { System.out.println(i); i++; } System.out.println("Using do-while loop:"); int i = 1; do { System.out.println(i); i++; } while (i <= 10); System.out.println("Using for-each loop:"); int[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; for (int number : numbers) { System.out.println(number); }
import java.util.Scanner; class Test { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter a number: "); int number = input.nextInt(); int temp = number; int remainder, sum = 0; while (temp != 0) { remainder = temp % 10; sum = sum + remainder; temp = temp / 10; } System.out.println("The sum of digits of " + number + " = " + sum); } catch (Exception e) { System.out.println(e); } } }
import java.util.Scanner; class Test { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter a number: "); int number = input.nextInt(); int temp = number; int remainder, reverse = 0; while (temp != 0) { remainder = temp % 10; reverse = (reverse * 10) + remainder; temp = temp / 10; } System.out.println("The reverse of " + number + " = " + reverse); } catch (Exception e) { System.out.println(e); } } }
import java.util.Scanner; class Test { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter a number: "); int number = input.nextInt(); int temp = number; int remainder, reverse = 0; while (temp != 0) { remainder = temp % 10; reverse = (reverse * 10) + remainder; temp = temp / 10; } if (number == reverse) { System.out.println(number + " is a Palindrome number"); } else { System.out.println(number + " is not a Palindrome number"); } } catch (Exception e) { System.out.println(e); } } }
import java.util.Scanner; public class Program30 { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter any postive integer: "); int number = input.nextInt(); int temp = number; int sum = 0; while(temp!=0){ int r = temp % 10; sum = sum + r*r*r; temp = temp / 10; } if(number == sum){ System.out.println("Armstrong number"); } else{ System.out.println("Not a Armstrong number"); } } } }
import java.util.Scanner; public class Program26 { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("How many fibonacci numbers? "); int n = input.nextInt(); int first = 0; int second = 1; for(int i=1; i<=n; i++){ if(i<=2){ System.out.print(" "+ (i-1)); }else{ int fibo = first + second; System.out.print(" "+fibo); first = second; second = fibo; } } } } }
public class LucasSeries { public static void main(String[] args) { int limit = 10; // Define the limit of the Lucas series System.out.println("Lucas series up to " + limit + ":"); generateLucasSeries(limit); } public static void generateLucasSeries(int limit) { int first = 2; // First number in the Lucas series int second = 1; // Second number in the Lucas series // Print the first two numbers System.out.print(first + " " + second + " "); // Generate subsequent numbers in the Lucas series for (int i = 3; i <= limit; i++) { int next = first + second; System.out.print(next + " "); // Update values for the next iteration first = second; second = next; } System.out.println(); // Print a new line after the series } }
// 1 // 1 2 // 1 2 3 import java.util.Scanner; public class Program31 { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter n = "); int n= input.nextInt(); for(int row=1; row<=n; row++){ for (int col=1; col<=row; col++){ System.out.print(" "+col); } System.out.println(); } } } }
// find sum of 1-10 using for loop public class Assignment10 { public static void main(String[] args) { } }
// find factorial of n public class Assignment11 { public static void main(String[] args) { } }
// print sum of odd numbers from m-n public class Assignment12 { public static void main(String[] args) { } }
// find nth fibonacci number import java.util.Scanner; public class Assignment13 { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("which fibonacci number you want to see? "); int n = input.nextInt(); } } }
// 1. generate and print palindrome numbers from m-n // 2. count and print number of palindrome numbers import java.util.Scanner; public class Assignment14 { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("start number: "); int m = input.nextInt(); System.out.print("end number: "); int n = input.nextInt(); int totalPalindromeNumber=0; System.out.println("Total Palindrome numbers : "+totalPalindromeNumber); } } }
// 1. generate and print armstrong numbers from m-n // 2. count and print number of armstrong numbers import java.util.Scanner; public class Assignment15 { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("start number: "); int m = input.nextInt(); System.out.print("end number: "); int n = input.nextInt(); int totalArmstrongNumber=0; System.out.println("Total armstrong numbers : "+totalArmstrongNumber); } } }
// Create a pattern like following one if n=4 /* 1 1 0 1 0 1 1 0 1 0 */ public class Assignment17 { public static void main(String[] args) { } }
break Statement: It terminates the current loop or switch statement and transfers control to the statement following the loop or switch.
continue Statement: It skips the rest of the current iteration of a loop and moves to the next iteration.
return Statement: It terminates the execution of a method and returns control to the caller.
throw Statement: It is used to explicitly throw an exception to handle exceptional situations.
break and continue example
// break Statement for (int i = 0; i < 5; i++) { if (i == 3) { break; } System.out.println("i: " + i); } // continue Statement for (int i = 0; i < 5; i++) { if (i == 2) { continue; } System.out.println("i: " + i); }
Prime number Program
import java.util.Scanner; public class Test { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter a positive integer: "); int number = input.nextInt(); int count = 0; if (number < 2) { System.out.println("Not Prime number"); } else { for (int i = 2; i <= Math.sqrt(number); i++) { if (number % i == 0) { count++; break; } } if (count == 0) { System.out.println("Prime number"); } else { System.out.println("Not Prime number"); } } } catch (Exception e) { System.out.println("Invalid input"); } } }
import java.util.Scanner; public class PrimeProgram { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { System.out.print("Enter a positive integer: "); int number = input.nextInt(); if (isPrime(number)) { System.out.println("Prime number"); } else { System.out.println("Not Prime number"); } } catch (Exception e) { System.out.println("Invalid input"); } } private static boolean isPrime(int number) { if (number < 2) { return false; } for (int i = 2; i <= Math.sqrt(number); i++) { if (number % i == 0) { return false; } } return true; } }
import java.util.Scanner; class Program25 { public static void main(String args[]) { try (Scanner input = new Scanner(System.in)) { int m, n; int count = 0; int totalprime = 0; System.out.print("Enter initial number:"); m = input.nextInt(); System.out.print("Enter last number: "); n = input.nextInt(); for (int i = m; i <= n; i++) { if (i < 2) { continue; } else { for (int j = 2; j < i; j++) { if (i % j == 0) { count++; break; } } if (count == 0) { System.out.println(i); totalprime++; } count = 0; } } System.out.println("total prime:" + totalprime); } } }
// validate user based on username and password // input username and password until username=="anis" and password=="123456" // if username and password does not match print "username/password is incorrect. Please try again" // if username and password does not match print "welcome to the system"
Declaration and Initialization:
[], and then the name of the array. For example: int[] numbers;new keyword, followed by the type and the size of the array. For example: numbers = new int[5];int[] numbers = new int[5];Accessing Elements:
int firstElement = numbers[0];numbers[0] = 10;Length:
length property: int size = numbers.length;Iterating Over an Array:
You can use a loop, such as the for loop, to iterate over the elements of an array. For example:
for (int i = 0; i < numbers.length; i++) { int element = numbers[i]; // Do something with the element }
Array Initialization with Values:
int[] numbers = {1, 2, 3, 4, 5};Multidimensional Arrays:
int[][] matrix = new int[3][4];int[][] numbers = new int[4][]; numbers[0] = new int[1]; numbers[1] = new int[2]; numbers[2] = new int[3]; numbers[3] = new int[4];
Array Copying:
System.arraycopy() method and the Arrays.copyOf() method to copy the elements of one array to another.public class Program32 { public static void main(String[] args) { int[] numbers; // array declaration numbers = new int[5]; //array creation numbers[0] = 10; numbers[1] = 20; numbers[2] = 30; numbers[3] = 40; numbers[4] = 50; int sum=0; for(int x=0; x<numbers.length;x++){ sum+=numbers[x]; } int max=numbers[0]; int min=numbers[0]; for(int x=1;x<numbers.length; x++){ if(max<numbers[x]){ max=numbers[x]; } if(min>numbers[x]){ min=numbers[x]; } } System.out.println("Sum of Array = "+sum); System.out.println("Average of Array = "+((float)sum/numbers.length)); System.out.println("Maximum number of Array = "+max); System.out.println("Minimum number of Array = "+min); } }
// for each or enhanched for loop import java.util.Scanner; public class Program33 { public static void main(String[] args) { try (Scanner input = new Scanner(System.in)) { String[] countries = {"Bangladesh", "Pakistan", "England", "India"}; for (String country : countries) { System.out.println(country); } } } }
public class Program34 { public static void main(String[] args) { int [][] numbers = new int[3][3]; // 3 rows x 3 columns = 9 items // first row numbers[0][0] = 1; numbers[0][1] = 2; numbers[0][2] = 3; // second row numbers[1][0] = 4; numbers[1][1] = 5; numbers[1][2] = 6; // third row numbers[2][0] = 7; numbers[2][1] = 8; numbers[2][2] = 9; // printing 2d array for(int row=0; row<numbers.length; row++){ for(int col=0; col<numbers[row].length; col++){ System.out.print(numbers[row][col]); } System.out.println(); } } }
import java.util.Scanner; // Matrix Program // A + B = ? public class Program35 { static void printMatrix(int[][] number) { for (int row = 0; row < number.length; row++) { for (int column = 0; column < number[row].length; column++) { System.out.print(" " + number[row][column]); } System.out.println(); } } public static void main(String[] args) { int[][] A = new int[2][3]; int[][] B = new int[2][3]; int[][] C = new int[2][3]; try (Scanner input = new Scanner(System.in)) { System.out.println("Input for A Matrix"); for (int row = 0; row < A.length; row++) { for (int column = 0; column < A[row].length; column++) { System.out.printf("A[%d][%d] = ", row, column); A[row][column] = input.nextInt(); } } System.out.println("Printing A Matrix"); printMatrix(A); System.out.println("Input for B Matrix"); for (int row = 0; row < B.length; row++) { for (int column = 0; column < B[row].length; column++) { System.out.printf("B[%d][%d] = ", row, column); B[row][column] = input.nextInt(); } } System.out.println("Printing B Matrix"); printMatrix(B); // calculating C=A+B for (int row = 0; row < B.length; row++) { for (int column = 0; column < B[row].length; column++) { C[row][column] = A[row][column] + B[row][column]; } } System.out.println("Printing C Matrix"); printMatrix(C); } } }
/** * 0 1 2 3 4 * 5 6 7 8 9 * 10 11 12 13 14 * 15 16 17 18 19 */ public class Test { public static void main(String[] args) { int[][] A = new int[4][5]; int count = 0; // assign values to the 2d array for (int i = 0; i < 4; i++) { for (int j = 0; j < 5; j++) { A[i][j] = count++; } } // print values to the 2d array for (int i = 0; i < 4; i++) { for (int j = 0; j < 5; j++) { System.out.print(A[i][j] + " "); } System.out.println(); } } }
/** * 0 * 1 2 * 3 4 5 * 6 7 8 9 */ public class Test { public static void main(String[] args) { int[][] A = new int[4][]; A[0] = new int[1]; A[1] = new int[2]; A[2] = new int[3]; A[3] = new int[4]; int count = 0; // assign values to the 2d array for (int i = 0; i < A.length; i++) { for (int j = 0; j < i + 1; j++) { A[i][j] = count++; } } // print values to the 2d array for (int i = 0; i < A.length; i++) { for (int j = 0; j < i + 1; j++) { System.out.print(A[i][j] + " "); } System.out.println(); } } }
import java.util.Arrays; public class Test { public static void main(String[] args) { int[] numbers = { 10, 4, 32, 45, 99, 2 }; Arrays.sort(numbers); System.out.print("Ascending order: "); for (int i = 0; i < numbers.length; i++) { System.
learnwithfair/java-documentation is a public repo on GitHub by learnwithfair. java (OOP) documentation with [learnwithfair, Learn with fair, Rahatul Rabbi, Md Rahatul Rabbi ,rahatulrabbi].
It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2024-05-03. Take My Repo does not judge from that whether it is maintained.

Free domain registration and practical DNS learning resources for everyone.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Reverse engineer anything with agents, from app behavior down to native binaries.


The Corona Dashboard is a comprehensive web application developed using HTML5, CSS3, Bootstrap, Tailwind CSS, JavaScript, jQuery, Ajax, React.js, PHP, Laravel, and MySQL, following the MVC Architecture
matlab instalation-doucmentation with [learnwithfair, Learn with fair, Rahatul Rabbi, Md Rahatul Rabbi ,rahatulrabbi]

Database Management System (DBMS) with [learnwithfair, Learn with fair, Rahatul Rabbi, Md Rahatul Rabbi ,rahatulrabbi]

github-documentation [learnwithfair, Learn with fair, Rahatul Rabbi, Md Rahatul Rabbi ,rahatulrabbi]
mern-ecommerce-electro-master [learnwithfair, Learn with fair, Rahatul Rabbi, Md Rahatul Rabbi ,rahatulrabbi]
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/learnwithfair/java-documentationTake My Repo has not tested this on your machine. Requirements come from the project's own documentation.