Java Codes Basic to Advance
2.03K subscribers
4 photos
2 videos
1 file
48 links
Download Telegram
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
👍2
// 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\"");
}
}
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
pt

And 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 👇
👍2🥰1
It's discussion group is now public
Join @java_group_pro
Select your group/channel/service
t.me/Sid_info/69
40+ String methods of java 👇
(Share)
// 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);
    }
}
👍1
// 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);
    }
}
// 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);
    }
}
// 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);
    }
}
// 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);
    }
}
// 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);
    }
}
👍1
// 7. replace()
public class ReplaceExample {
    public static void main(String[] args) {
        String str = "Hello, World!";
        String replacedString = str.replace('l', 'z');
        System.out.println("String after replacement: " + replacedString);
    }
}
1
// 8. contains()
public class ContainsExample {
    public static void main(String[] args) {
        String str = "Hello, World!";
        boolean contains = str.contains("World");
        System.out.println("Does the string contain 'World'? " + contains);
    }
}
// 9. trim()
public class TrimExample {
    public static void main(String[] args) {
        String spacedString = "   Some spaces   ";
        String trimmedString = spacedString.trim();
        System.out.println("Trimmed string: '" + trimmedString + "'");
    }
}
// 10. isEmpty()
public class IsEmptyExample {
    public static void main(String[] args) {
        String emptyString = "";
        boolean isEmpty = emptyString.isEmpty();
        System.out.println("Is the string empty? " + isEmpty);
    }
}
// 11. startsWith()
public class StartsWithExample {
public static void main(String[] args) {
String str = "Hello, World!";
boolean startsWith = str.startsWith("Hello");
System.out.println("Does the string start with 'Hello'? " + startsWith);
}
}
// 12. endsWith()
public class EndsWithExample {
public static void main(String[] args) {
String str = "Hello, World!";
boolean endsWith = str.endsWith("World!");
System.out.println("Does the string end with 'World!'? " + endsWith);
}
}
👍1
// 13. charAt()
public class CharAtExample {
public static void main(String[] args) {
String str = "Hello, World!";
char character = str.charAt(4);
System.out.println("Character at index 4: " + character);
}
}