This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int i = 3; | |
int j = 10; | |
++i; | |
j -= i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class question4 | |
{ | |
public static void main ( String[] args ) | |
{ | |
int unitCost = 8; | |
int items = 5; | |
System.out.println("total cost: " + (unitCost * items) ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
short a=12 ; | |
int b=33 ; | |
float x = 2.3; | |
double y = 3.14; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class question4 | |
{ | |
public static void main ( String[] args ) | |
{ | |
int totalCost = 6; | |
int items = 12; | |
System.out.println("cost per item: " + totalCost/items ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main() | |
{ | |
int i = 3; | |
int l = i / 2; | |
int k = i % 2; | |
Systemu.out.print(l+" "+k); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main() | |
{ | |
int a; | |
a = 5 + 3 * 5; | |
System.out.print(a); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) | |
{ | |
int a = 21; | |
int c ; | |
c = a++; | |
System.out.print(c); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String strA; | |
String strB = new String("Cheese"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String strA; | |
String strB = new String("Cheese"); | |
System.out.print( strB ); | |
strA = new String(" Whizz"); | |
System.out.println( strA ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String strA = new String("Roasted "); | |
String strB = new String("Acorns "); | |
strA = strB; | |
OlderNewer