master
Chloe Fontenot 🏳️‍⚧️ 2022-09-28 15:25:46 +07:00
parent bd414b3d51
commit bb527bf234
6 changed files with 25 additions and 3 deletions

@ -20,6 +20,6 @@ public class Mavenproject1 {
System.out.println(x | y); // result is 11
System.out.println(0 ^ 1); // result is 1
System.out.println(1 ^ 1); // result is 0
System.out.println(0 ^ 0); // result is 11
System.out.println(0 ^ 0); // result is 11 (Wrong Markou, Wrong)
}
}

@ -11,8 +11,8 @@ package com.mycompany.mavenproject1;
public class PrePostIncrement {
public static void main(String[] args)
{
int j = 0;
int i = ++j + j * 5;
int j = 2;
int i = j++ + j * j + 1;
System.out.println("i is: " + i);
}

@ -0,0 +1,22 @@
/*
* 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 TypeCasting {
public static void main(String[] args)
{
double b = 5.3;
int c = (int) b;
double d = ((double) 1 / 2);
System.out.println(b);
System.out.println(c);
System.out.println(d);
}
}