master
Chloe Fontenot 🏳️‍⚧️ 2022-11-09 17:38:03 +07:00
parent bb99b4210c
commit c9d6ca2982
10 changed files with 90 additions and 1 deletions

@ -0,0 +1,23 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.mycompany.mavenproject1;
/**
*
* @author caleb
*/
public class CompareTo {
public static void main(String[] args)
{
System.out.println("Abcd".compareTo("abc"));
System.out.println("abc".compareTo("Abcd"));
String s1 = "abcd", s2 = "ab";
System.out.println(!s2.contains(s1));
System.out.println(!(!s1.contains(s2) || !s1.contains(s2) ));
System.out.println(!s1.contains(s2));
}
}

@ -0,0 +1,19 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.mycompany.mavenproject1;
/**
*
* @author caleb
*/
public class Loop12 {
public static void main(String[] args)
{
for (int i = 0; i < 6; i++)
for (int j = 0; j < i; j += 2)
System.out.println("java");
}
}

@ -0,0 +1,21 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.mycompany.mavenproject1;
/**
*
* @author caleb
*/
public class Loop13 {
public static void main(String[] args)
{
int count = 12;
do {
System.out.println("Welcome to Java");
} while (count-- > 8);
}
}

@ -0,0 +1,26 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package com.mycompany.mavenproject1;
/**
*
* @author caleb
*/
public class Loop15 {
public static void main(String[] args)
{
int balance = 8;
while (true) {
if (balance++ < 15) {
break;
}
balance += 2;
}
System.out.println(balance--);
}
}

@ -12,7 +12,7 @@ public class Unicode {
public static void main(String[] args)
{
//System.out.println("\u2764");
char char_a = 'a', char_0 = '0', char_A = 'A';
char char_a = 'a', char_0 = '2', char_A = 'A';
System.out.println((int) char_0 + " = 0\n" + (int) char_a + " = a\n" + (int) char_A + " = A");
}
}