Java Codes Basic to Advance
رفتن به کانال در Telegram
2 333
مشترکین
اطلاعاتی وجود ندارد24 ساعت
-37 روز
-2030 روز
آرشیو پست ها
// 6. indexOf()
public class IndexOfExample {
public static void main(String[] args) {
String str = "Hello, World!";
int index = str.indexOf('o');
System.out.println("Index of 'o': " + index);
}
}// 5. substring()
public class SubstringExample {
public static void main(String[] args) {
String str = "Hello, World!";
String substring = str.substring(7);
System.out.println("Substring from index 7: " + substring);
}
}// 4. equals()
public class StringEqualityExample {
public static void main(String[] args) {
String str1 = "hello";
String str2 = "HELLO";
boolean isEqual = str1.equals(str2);
System.out.println("Are strings equal? " + isEqual);
}
}// 3. toLowerCase()
public class LowerCaseExample {
public static void main(String[] args) {
String str = "Hello, World!";
String lowerCaseString = str.toLowerCase();
System.out.println("Lowercase string: " + lowerCaseString);
}
}// 2. toUpperCase()
public class UpperCaseExample {
public static void main(String[] args) {
String str = "Hello, World!";
String upperCaseString = str.toUpperCase();
System.out.println("Uppercase string: " + upperCaseString);
}
}// 1. length()
public class StringLengthExample {
public static void main(String[] args) {
String str = "Hello, World!";
int length = str.length();
System.out.println("Length of the string: " + length);
}
}You can practice your codes in
@codeCompiler_bot
It supports short coding 👇
For upper part of java you can simply write
"Start"And for lower part
"End"Then in middle you can write java code But one thing more You don't need to write big print statement like
System.out.println();Just write
ptAnd then your code without parenthesis Full example
"Start"
Pt "hi this is mine short java"
"End"
You can run this code on @codeCompiler_bot using
/jv command
You can convert this code in real java code by using
/rjv command
Here is more short code example
import java.util.Scanner;
"Start"
Scanner scanner = new Scanner(System.in);
Pt"Enter an integer: "
int number = scanner.nextInt();
Pt"You entered: " + number
scanner.close();
"End"
See practical example 👇
t.me/LogicB_Support/11005
Is it easy give reactions or ask questions 👇// Run and see bharateey flag clolours
public class Main{
public static void main(String[] args){
System.out.println(" Ye Hain\n bharat ke flag\n\"ke colours\"");
}
}Are you added coding folder? 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
Ab aap log apna khud ka Compiler bot bana sakte hain easily 🥳🥳🔥
Apne manpasand name aur username se
Create your own
By using @CloneCompiler_bot
See full details: Click Here
// Factotial from recursion in java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.print("Enter Number: " );
int n = s.nextInt();
if(n>26)
System.out.print("Please enter number less than 25\n" );
else{
System.out.println("Showing factorial for "+ n + " Number" );
System.out.print("\n" +Main.f(n));
}
}
// Factorial value calculation + series printing
static long f(long n){
if (n==1){
System.out.print(n);
return n;
}
else{
System.out.print(n + " * ");
return n*f(n-1);
}
}
} // @Java_Codes_ProLearn in 55 seconds
How to run codes in telegram 👇
https://t.me/logicBots/163
// Atithmetic Operations in Java
public class MyClass {
public static void main(String args[]) {
// declaring variables
int add, sub, div, mul, rem;
// Declaring two varables
int x=4;
int y=2;
// performing Operations
add = x+y; // Addition
sub = x-y; // Subtraction
div = x/y; // Division
mul = x+y; // Multiply
rem= x%y; // reminder
// Showing results
System.out.println("4 + 2 = "+ add);
System.out.println("4 - 2 = "+ sub);
System.out.println("4 * 2 = "+ mul);
System.out.println("4 / 2 = "+ div);
System.out.println("4 % 2 = "+ rem);
}
}इस बाॅट में कोड रन करना सीखें। Learn how to run code in this bot.@CodeCompiler_Bot लाभ (Advantage): आप किसी को भी रियल टाइम में कोड का आउटपुट दिखा सकते हो, जिससे अगर आपके कोड में कोई गलती है तो वह भी सरलता से एक दूसरे से डिस्कस करके साॅल्व कर सकते हो। See features written in pic ☝️☝️ You can show the output of the code to anyone in real time, so that if there is any mistake in your code, they can easily solve it by discussing with each other. Full tutorial: https://t.me/logicBots/147
How to run manually without clicking on show button
Click on run button here [in code]
Go to @compiler0bot
Type /start run
You will see code is running there which you clicked here 😉
Notes 📝 :
Telegram.me/BCA_Sem1_Notes
Telegram.me/BCA_Sem2_Notes
Telegram.me/BCA_Sem3_Notes
Telegram.me/BCA_Sem4_Notes
Telegram.me/BCA_Sem5_Notes
Telegram.me/BCA_Sem6_Notes
Code practice Channels:
Telegram.me/C_Codes_pro
Telegram.me/CPP_Codes_pro
Telegram.me/Python_Codes_pro
Telegram.me/Java_Codes_Pro
Telegram.me/Nodejs_Codes_Pro
Info channel:
Telegram.me/Btech_bca_mca
Discussion groups:
Telegram.me/bca_mca_btech
Telegram.me/bca_group_ignou
Learn coding:
Youtube.com/IgnouStudyCenter
