Java Advance - Dxe
Java Advance - Dxe
Turn on notifications
Get notified of new messages on your computer.Turn on desktop notifications
Janani
Tuesday
NAHTNAJIN
yesterday
Reacted to: "Good morning anna "
Gw
yesterday
https://youtu.be/uUj7VhlZRXs?si=X0JZfmLUHmwfYDb8
16_ Hr Navin ( Official Community Group)
yesterday
~ Hr_Navin (Admin)
: https://tapthe.link/EoC1Hi0Qv Hello Techies Today's Video Out Zoho full stack
developer sharing experience
javaprograms.pdf • 35 pages
4
~ ✬🇻͢ɪͥ ᴘⷨ ✦͜͡⃝⃝ 🇹𝖆𝖒𝖎𝖑⸙⃟ ⃟ၴ࿐
: Foundation of data science book erukka
Yuva Jit
16:13
INTERNSHIP NEXUS
Saturday
~ Abigail
: NOTE We will allot the SLOTS only on first come first serve basis, so hurry up grab
the opportunity of doing internship with your dream company.
Palanisami
Sunday
Hann
HR Master Class 04
Sunday
+91 6369 782 520 joined via an invite link
Trisha Jit
Sunday
Mm seri
Prithika jit
Tuesday
M ok
Sofia Jit
13:46
javaprograms.pdf • 35 pages
Your personal messages are end-to-end encrypted
Get WhatsApp for Windows
Yuva Jit
77 kB
18:38
Ok da18:52
18:52
11/01/2024
Oii22:35
22:35
Tomorrow saree ah wear pandre22:36
22:36
12/01/2024
Ila da07:59
07:59
Nee08:00
08:00
Katren da08:17
08:17
15/01/2024
06:36
TODAY
Forwarded
javaprograms.pdf
35 pages•PDF•253 kB•
12:06
java intermediate.docx
DOCX•25 kB•
16:13
JAVA ADVANCED PROGRAM.docx
DOCX•23 kB•
16:13
Type a message
JAVA ADVANCE QUESTIONS
PROGRAM:
String ten[] = { " ", " ", " Twenty", " Thirty", " Forty", " Fifty", " Sixty", "Seventy", " Eighty",
" Ninety" };
if (n > 19)
{
System.out.print(ten[n / 10] + " " + one[n % 10]);
}
else
{
System.out.print(one[n]);
}
if (n > 0)
System.out.print(ch);
}
int n=28;
System.out.print(n);
if (n <= 0)
{
Output:
28Twenty Eight
PROGRAM:
Output
***************
******* *******
****** ******
***** *****
**** ****
*** ***
** **
**
**
** **
*** ***
**** ****
***** *****
****** ******
******* *******
***************
PROGRAM:
import java.util.Scanner;
public class PatternNumberPyramidRev
{
public static void main(String args[])
{
int i, j, k, n, a;
Scanner sc = new Scanner(System.in);
System.out.println("Enter the n values");
n = sc.nextInt();
a = n;
for (i = 1; i <= n; i++)
{
for (j = a; j > 1; j--)
{
System.out.print(" ");
}
for (k = i; k != 0; k--)
{
System.out.print(k);
}
a--;
for (int l = 2; l <= i; l++)
{
System.out.print(l);
}
System.out.println();
}
}
}
Output
Enter the n values5
1
212
32123
4321234
543212345
PROGRAM:
public class LargestSmallest
{
public static void main(String[] args)
{
int a[] = new int[] { 23, 34, 13, 64, 72, 90, 10, 15, 9, 27 };
int min = a[0]; // assume first elements as smallest number
int max = a[0]; // assume first elements as largest number
for (int i = 1; i < a.length; i++) // iterate for loop from arrays 1st index (secondelement)
{
if (a[i] > max)
{
max = a[i];
}
if (a[i] < min)
{
min = a[i];
}
}
System.out.println("Largest Number in a given array is : " + max);
System.out.println("Smallest Number in a given array is : " + min);
}
}
Output
Largest Number in a given array is : 90Smallest Number in a given array is : 9
PROGRAM:
Output
Largest Number: 99Second Largest Number: 78
PROGRAM:
else
{
input[++j] = input[i++];
}
}
int[] output = new int[j + 1];
for (int k = 0; k < output.length; k++)
{
output[k] = input[k];
}
return output;
}
public static void main(String a[])
{
int[] input1 = { 2, 3, 6, 6, 8, 9, 10, 10, 10, 12, 12 };
int[] output = removeDuplicates(input1);
System.out.print("Input Elements: \n");
for (int i : input1)
{
System.out.print(i + " ");
}
System.out.print("\nOutput Elements: \n");
for (int i : output)
{
System.out.print(i + " ");
}
}
}
Output
Input Elements:
2 3 6 8 9 10 12 10 10 12 12
Output Elements:
2 3 6 8 9 10 12
PROGRAM:
class MatrixAddition
{
public static void main(String args[])
{
int[][] a = new int[][] { { 1, 2, 3},{ 4, 5, 6},{ 7, 8, 9} };
int[][] b = new int[][] { { 10, 11, 12},{ 13, 14, 15},{ 16, 17, 18} };
int[][] c = new int[3][3];
if(a.length == b.length && a[0].length == b[0].length)
{
for(int i = 0;i < a.length;i++)
{
for(int j = 0;j < a[i].length;j++)
{
c[i][j] = a[i][j] + b[i][j];
}
}
}
else
{
System.out.println("'A' and 'B' Matrix are not SAME");
return;
}
System.out.println("The Matrix 'A' Value:");
for(int i = 0;i < a.length;i++)
{
for(int j = 0;j < a[i].length;j++)
{
System.out.print(a[i][j] + " ");
}
System.out.println();
}
Output
The Matrix 'A' Value:
123
456
789
The Matrix 'B' Value:
10 11 12 13 14 15
16 17 18
The Addition Matrix of 'A' and 'B' Value:
11 13 15 17 19 21
23 25 27
PROGRAM:
class DiagonalMatrix
{
public static void main(String args[])
{
int[][] a = new int[][] { { 1, 0, 1},{ 0, 3, 0},{ 0, 0, 3} };
boolean setValue = true;
abc: for(int i = 0;i < a.length;i++)
{
for(int j = 0;j < a[i].length;j++)
{
if(i == j)
{
if(a[i][j] == 0)
{
setValue = false;
break abc;
}
}
else if(a[i][j] != 0)
{
setValue = false;
break abc;
}
}
}
if(setValue == true)
{
System.out.println("The Given Matrix is a Diagonal Matrix");
}
else
{
System.out.println("The Given Matrix is not a Diagonal Matrix");
}
}
}
Output
The Given Matrix Value:
101
030
003
The Given Matrix is not a Diagonal Matrix
11. Program to count each words and total number of words in given string
PROGRAM:
import java.io.IOException;
fr[i]++;
}
}
}
int total = 0;
System.out.println("Words and words count:");
for (int i = 0; i < words.length; i++)
{
if (words[i] != "")
{
total += fr[i];
}
}
System.out.println("Total words counted: " + total);
}
}
Output
Words and words count:
banna=1
fruit=2
apple=3
hello=2
hi=3
Total words counted: 11
12. Program to find difference of minimum and maximum numbers of array in java
PROGRAM:
class GFG {
return result;
}
// Driver code
public static void main(String[] args) {
int arr[] = {10, 100, 300, 200, 1000, 20, 30};
int n = arr.length;
int k = 3;
System.out.println(minDiff(arr, n, k));
}
}
Output
20