Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 Guess { | |
public static void main (String [] args) | |
throws java.io.IOException { | |
char ch, answer = 'K'; | |
System.out.println("I'm thinking of a letter between A and Z"); | |
System.out.println("Can you guess it: "); |
This file contains hidden or 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
/** | |
* made by damnn | |
*/ | |
public class demo { | |
public static void main(String [] args) { | |
boolean b; | |
b = false; | |
System.out.println("b is " + b); | |
b = true; |
This file contains hidden or 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
import java.awt.Point; | |
public class SetPoints { | |
public static void main(String [] args) { | |
Point location = new Point(4, 13); | |
System.out.println("Starting location: "); | |
System.out.println("X equals " + location.x); | |
System.out.println("Y equals " + location.y); |
This file contains hidden or 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
import java.util.StringTokenizer; | |
public class showToken { | |
public static void main(String [] args) { | |
StringTokenizer st1, st2; | |
String quote1 = "JACK 3 -1/16"; | |
st1 = new StringTokenizer(quote1); | |
System.out.println("Token 1: " + st1.nextToken()); |
This file contains hidden or 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 class variables { | |
public static void main(String [] arguments) { | |
int x, y, z; // x, y, and z are all declared | |
x = 42; // x is given the value of 42 | |
y = x++; // y is given x's value which is 42 before it is incremented | |
// and x is then incremented to 43 | |
z = ++x; // x is incremented to 44, and z is given x's value | |
System.out.println("x is: " + x); | |
System.out.println("y is: " + y); |
This file contains hidden or 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 class weather { | |
public static void main(String [] args) { | |
float fah = 86; | |
System.out.println(fah + "Degrees Fahrenheit is..."); | |
// TO convert Fahrenheit into celsius | |
//Begin by subtracting 32 | |
fah = fah - 32; | |
// divide the answer by 9 | |
fah = fah / 9; | |
//Multiply that answer by 5 |
This file contains hidden or 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 class variables { | |
public static void main(String [] arguments) { | |
final char UP = 'U'; | |
byte initialLevel = 12; | |
short Location = 13250; | |
int score = 3423842; | |
boolean newGame = true; | |
System.out.println("Level: " + initialLevel); | |
System.out.println("up: " + UP); |
This file contains hidden or 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
import java.util.Scanner; | |
/** | |
* Program to check for a palindrome. | |
* | |
* by saurav mani tripathi | |
* for medium.com/damnn | |
*/ | |
This file contains hidden or 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
import java.util.Scanner; | |
/** | |
* Program to display a multiplication table where the user inputs the number of table to | |
* display | |
* | |
* made by: Saurav mani Tripathi | |
* | |
* published on github and medium under profile of Dammn | |
*/ |