uz
Feedback
Java Codes Basic to Advance

Java Codes Basic to Advance

Kanalga Telegram’da o‘tish
2 333
Obunachilar
Ma'lumot yo'q24 soatlar
-37 kunlar
-2030 kunlar

Ma'lumot yuklanmoqda...

Taglar buluti
Ma'lumot yo'q
Muammo bormi? Iltimos, sahifani yangilang yoki bizning qo'llab-quvvatlash boshqaruvchimizga murojaat qiling>.
Kirish va chiqish esdaliklari
---
---
---
---
---
---
Obunachilarni jalb qilish
Yanvar '26
Yanvar '26
+3
0 kanalda
Dekabr '25
+20
0 kanalda
Get PRO
Noyabr '25
+18
0 kanalda
Get PRO
Oktabr '25
+14
0 kanalda
Get PRO
Sentabr '25
+61
0 kanalda
Get PRO
Avgust '25
+78
0 kanalda
Get PRO
Iyul '25
+86
0 kanalda
Get PRO
Iyun '25
+49
0 kanalda
Get PRO
May '25
+31
0 kanalda
Get PRO
Aprel '25
+26
0 kanalda
Get PRO
Mart '25
+36
0 kanalda
Get PRO
Fevral '25
+43
0 kanalda
Get PRO
Yanvar '25
+89
0 kanalda
Get PRO
Dekabr '24
+76
0 kanalda
Get PRO
Noyabr '24
+64
0 kanalda
Get PRO
Oktabr '24
+84
0 kanalda
Get PRO
Sentabr '24
+143
0 kanalda
Get PRO
Avgust '24
+226
0 kanalda
Get PRO
Iyul '24
+125
2 kanalda
Get PRO
Iyun '24
+170
0 kanalda
Get PRO
May '24
+68
0 kanalda
Get PRO
Aprel '24
+86
1 kanalda
Get PRO
Mart '24
+80
1 kanalda
Get PRO
Fevral '24
+786
0 kanalda
Get PRO
Yanvar '240
0 kanalda
Get PRO
Dekabr '230
4 kanalda
Get PRO
Noyabr '230
6 kanalda
Get PRO
Oktabr '230
0 kanalda
Get PRO
Sentabr '23
+44
0 kanalda
Get PRO
Avgust '23
+132
0 kanalda
Get PRO
Iyul '23
+82
0 kanalda
Get PRO
Iyun '23
+74
0 kanalda
Get PRO
May '23
+77
0 kanalda
Get PRO
Aprel '23
+75
0 kanalda
Get PRO
Mart '23
+77
0 kanalda
Get PRO
Fevral '23
+76
0 kanalda
Get PRO
Yanvar '23
+93
0 kanalda
Get PRO
Dekabr '22
+266
0 kanalda
Sana
Obunachilarni jalb qilish
Esdaliklar
Kanallar
03 Yanvar0
02 Yanvar+1
01 Yanvar+2
Kanal postlari
Sabhi log arattai app install karlo Hame apne desh ki app ko support karna chahiye Vahi pe ek doosre se bat Karo whatsapp ki bajaye Dheere dheere sare log whatsapp chhod ke arattai use karo Isme aapko hamare sare arattai app me jo groups/channels hai aur honge vo milte rahenge 👇 https://aratt.ai/@ignoustudycenter

2
Join BCA/MCA developers group on arattai A Indian chat app by zoho Supported by government https://chat.arattai.in/groups/t43545f313237373536333834333438343434363931355f32303030353533333235382d47437c3031303131353032353136343137353935303935383035393830
496
3
New Bot @VideoCompress0bot Direct send your large size video to this bot and it will convert to small size Warning: Don't send already compressed video or low quality video other wise it will increase those size instead decreasing
557
4
// Shows Indian Time import java.time.*; import java.time.format.DateTimeFormatter; public class ISTTime { public static void main(String[] args) { // Get current time in IST ZoneId istZone = ZoneId.of("Asia/Kolkata"); ZonedDateTime istTime = ZonedDateTime.now(istZone); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm:ss"); System.out.println("Time (IST): " + istTime.format(formatter)); } } // Output:
585
5
Join @LogicBots For Getting Updates of our bots Sujjestion for new bot Sujjestion for new features https://t.me/logicBots
526
6
Matn yo'q...
0
7
Best time to buy /sell any stock public class buysell { public static int buySellStock(int prices[]) { int MaxProfit = 0; int buyPrice = Integer.MAX_VALUE; for (int index = 0; index < prices.length; index++) { if (buyPrice < prices[index]) { int profit = prices[index] - buyPrice; MaxProfit = Math.max(profit, MaxProfit); } else { buyPrice = prices[index]; } } return MaxProfit; } public static void main(String[] args) { int prices[] = { 7, 1, 5, 6, 2, 3 }; System.out.println(buySellStock(prices)); } } Output: 5
526
8
TrapRainWater Code time complexibilty O(n) public class traprainwat { public static int trapwater(int height[]) { // left max int n = height.length; int leftMax[] = new int[n]; leftMax[0] = height[0]; for (int i = 1; i < n; i++) { leftMax[i] = Math.max(height[i], leftMax[i - 1]); } // return leftMax; // for (int i = 0; i < n; i++) { // System.out.print(leftMax[i]); // } // right max int rightMax[] = new int[n]; rightMax[n - 1] = height[n - 1]; for (int i = n - 2; i >= 0; i--) { rightMax[i] = Math.max(rightMax[i + 1], height[i]); } // for (int i = 0; i < rightMax.length; i++) { // System.out.print(rightMax[i]); // } // loop int traprainw = 0; for (int i = 0; i < n; i++) { // waterlevel=min(leftmax,rightmax) int waterlevel = Math.min(leftMax[i], rightMax[i]); // traprainwater=waterlevel-height[i] traprainw += waterlevel - height[i]; } return traprainw; } public static void main(String[] args) { int height[] = { 4, 2, 0, 6, 3, 2, 5 }; System.out.println(trapwater(height)); } } Output: 11
487
9
Your Favorite language?
445
10
Maximum Subarray sum using Kadane's Algorithm. import java.util.*; public class Kadane { public static void kaddanelgoSum(int numbers[]) { int currsum = 0; int maxsum = Integer.MIN_VALUE; for (int index = 0; index < numbers.length; index++) { currsum = currsum + numbers[index]; if (currsum < 0) { currsum = 0; } // System.out.println(currsum); // if (maxsum < currsum) { // maxsum = currsum; // } maxsum = Math.max(currsum, maxsum); } System.out.println("max sum is : " + maxsum); } public static void main(String[] args) { // int numbers[] = { 2, 3, 4, 5 }; int numbers[] = { -2, -3, 4, -1, -2, 1, 5, -3, }; kaddanelgoSum(numbers); } } Output: max sum is : 7
524
11
Subarray public class subArr { public static void subArray(int numbers[]) { for (int i = 0; i < numbers.length; i++) { int start = i; // subarr for (int j = i; j < numbers.length; j++) { int end = j; // System.out.print(numbers[j]); for (int k = start; k <= end; k++) { System.out.print(+numbers[k] + " "); } System.out.println(); } System.out.println(); } } public static void main(String[] args) { int numbers[] = { 2, 4, 6, 8, 10 }; subArray(numbers); } } Output: 2 2 4 2 4 6 2 4 6 8 2 4 6 8 10 4 4 6 4 6 8 4 6 8 10 6 6 8 6 8 10 8 8 10 10
445
12
Reverse an array public class reverseArr { public static void reverse(int numbers[]) { int start = 0; int last = numbers.length - 1; while (start < last) { int temp = numbers[last]; numbers[last] = numbers[start]; numbers[start] = temp; start++; last--; } } public static void main(String[] args) { int numbers[] = { 2, 4, 6, 8, 10, 12, 14, 16 }; reverse(numbers); for (int i = 0; i < numbers.length; i++) { System.out.print(numbers[i] + " "); } } } // time complexbilty: 0(n) // space complexbilty: 0(1) Output: 16 14 12 10 8 6 4 2
369
13
Diamond Pattern of number n public class diamond { public static void diamond_pattern(int n) { for (int i = 1; i <= n; i++) { // blank space for (int j = 1; j <= (n - i); j++) { System.out.print(" "); } // star for (int j = 1; j <= 2 * (i - 1) + 1; j++) { System.out.print("*"); } System.out.println(); } for (int i = n; i >= 1; i--) { // blank space for (int j = 1; j <= (n - i); j++) { System.out.print(" "); } // star for (int j = 1; j <= 2 * (i - 1) + 1; j++) { System.out.print("*"); } System.out.println(); } } public static void main(String[] args) { diamond_pattern(5); } } Output: * *** ***** ******* ********* ********* ******* ***** *** *
494
14
Hollow Rhombus Pattern for number n public class hollowrhombus { public static void hollowrhombus_pattern(int n) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= n - i; j++) { System.out.print(" "); } for (int j = 1; j <= n; j++) { if (i == 1 | i == n | j == 1 | j == n) { System.out.print("*"); } else { System.out.print(" "); } } System.out.println(); } } public static void main(String[] args) { hollowrhombus_pattern(5); } } Output: ***** * * * * * * *****
421
15
Solid Rhombus Pattern for number n public class solidrhomus { public static void solidrhomus_pattern(int n) { for (int i = 1; i <= n; i++) { for (int index = 1; index <= 2 * (n - i); index++) { System.out.print(" "); } for (int index = 1; index <= n; index++) { System.out.print("* "); } System.out.println(); } } public static void main(String[] args) { solidrhomus_pattern(5); } } Output: * * * * * * * * * * * * * * * * * * * * * * * * *
390
16
Butterfly Pattern using java of number n public class Butterflypattern { public static void butterfly_pattern(int n) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { System.out.print("*"); } for (int j = 1; j <= 2 * (n - i); j++) { System.out.print(" "); } for (int index = 1; index <= i; index++) { System.out.print("*"); } System.out.println(); } for (int i = n; i >= 1; i--) { for (int j = 1; j <= i; j++) { System.out.print("*"); } for (int j = 1; j <= 2 * (n - i); j++) { System.out.print(" "); } for (int index = 1; index <= i; index++) { System.out.print("*"); } System.out.println(); } } public static void main(String[] args) { butterfly_pattern(5); } } Output: * * ** ** *** *** **** **** ********** ********** **** **** *** *** ** ** * *
335
17
0-1 Triangle Pattern public class zeroone { public static void zeroOne_Triangle(int n) { for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { if ((i + j) % 2 == 0) { System.out.print("1 "); } else { System.out.print("0 "); } } System.out.println(); } } public static void main(String[] args) { zeroOne_Triangle(5); } } Output: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1
320
18
Floyd`s Triangle Pattern. public class floydtriangle { public static void floyd(int n) { int count = 1; for (int i = 1; i <= n; i++) { for (int j = 1; j <= i; j++) { System.out.print(count + " "); count++; } System.out.println(); } } public static void main(String[] args) { floyd(5); } } OutPut: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
324
19
Ai telegram chatbot creation project https://youtu.be/s6EQACzmLII?si=pnDL8IdAPC7HSlJl
397
20
Matn yo'q...
0