Studying
This commit is contained in:
parent
bd414b3d51
commit
bb527bf234
@ -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);
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user