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
/* | |
* This is the main class which will have the main method. | |
*/ | |
import javax.swing.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
class Main { | |
private JFrame frame; | |
private MyPanel graph; | |
private JPanel inputPanel; |
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
import java.awt.*; | |
import java.awt.event.*; | |
import javax.swing.*; | |
public class Game { | |
private JPanel countdown, background; | |
private MyPanel move; | |
private JButton button; | |
private JLabel countdownL; | |
private Timer timer; |
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
import java.util.Scanner; | |
public class Game { | |
public static void main (String args[]) { | |
Scanner scan = new Scanner(System.in); | |
while (true) { | |
System.out.println ("Write 'p' to start"); | |
if (scan.next().equalsIgnoreCase("p")) | |
playGame(); |
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
import java.io.*; | |
import java.net.*; | |
class DailyAdviseServer { | |
String[] adviseList = {"Take smaller bites", "Go for the tight jeans. No You do not look fat in those", | |
"One word: inappropriate", "Just for today, be honest", "You might want to rethink the haircut"}; | |
public static void main (String args[]) { | |
DailyAdviseServer server = new DailyAdviseServer(); |
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
/** | |
* User Input - 432 | |
* Output - Four Hundred and Thirty-Two | |
* | |
* Note:- Input should be under 10,000 | |
*/ | |
package random; | |
import java.util.Scanner; | |
class Num { | |
public static void main (String[] args) { |
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
import java.util.Scanner; | |
class PrimorialFinder | |
{ | |
public static void main (String args[]) | |
{ | |
Scanner scan = new Scanner (System.in); | |
System.out.println ("Enter the number"); | |
int num = scan.nextInt(); | |
long primorial = 1, factor = 1; | |
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
import java.util.Scanner; | |
class IPCheck | |
{ | |
public static void main (String args[]) | |
{ | |
Scanner sc = new Scanner (System.in); | |
System.out.println ("Please enter the IP address to check for its validity:"); | |
String in = sc.next(); | |