美文网首页
Java入门总结

Java入门总结

作者: Pingouin | 来源:发表于2022-01-14 16:07 被阅读0次

    根据Udemy的Java教程写的笔记,新手友好。
    🔗:https://www.udemy.com/course/learn-java-programming-java-beginners-course/

    基础语法

    public class name {
              public static void main(String[] args){
                     System.out.println("This is the 2nd instruction that  i have executed");
                     System.out.print("my name is ");
    }
    }
    

    缩写 psvm tab
    缩写 sout tab
    缩写 souf tab

    operators

    arithmetic operators relational operators logical operators assignment operators

    concatenation

    public class concatenation {
        public static void main(String[] args) {
    
            int number =10;
            String text = "test";
            double doubleNumber = 11.1;
            float floatNumber = 11.1F;
            boolean truth = true;
            char  c = '*';
            System.out.println("my string vatriable has the value "+text);
    
            System.out.printf("I have decalred a string variable with the value %s",text);
            System.out.println();
            System.out.printf("I have decalred a int varibale with the value %d",number);
            System.out.println();
            System.out.printf("I have decalred a double varibale %f " +
                    "and a string with the value %s", doubleNumber,text);
            System.out.println();
            System.out.printf("We are decalring a boolean %b",truth);
    
        }
    }
    
    

    char %c
    int %d
    double %f

    equality of two strings

    Java is a case sensitve language

    .equalsIgnoreCase

    相关文章

      网友评论

          本文标题:Java入门总结

          本文链接:https://www.haomeiwen.com/subject/rliacrtx.html