Format:
Recent snippets matching language of Java
import java.io.*; public class DecList { public static void main(String[]args) { FileOutputStream p; File AudioFile = new File( "k523jsyt2idjh.d03" ); long length = AudioFile.length();
6 Views
no comments
import javax.swing.JApplet; import java.awt.Graphics; /** * This class extends applet and creates a new instance of FrameGUI * @author Darren */ public class GUIApplet extends JApplet { /** * initiates the applet
6 Views
no comments
//imports import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JPanel; import javax.swing.JButton; import java.awt.Color;
6 Views
no comments
@Override public void postVisit(Contract node) { // check if we already processed this node if (!mVisitedNodes.containsKey(node)) { IntermediateNode tmpNode = null; if (node instanceof DataSourceContract<?, ?>) { tmpNode = new IntermediateNode(IntermediateNode.OperationType.DataSource, (Contract) node);
8 Views
no comments
import java.io.*; public class DecList { public static void main(String[]args) { FileOutputStream p; File AudioFile = new File( "k523jsyt2idjh.d03" ); long length = AudioFile.length();
10 Views
no comments
/* Parvulescu Cosmin Grupa 202 cerc.java */ package Mostenire_Cerc_Cilindru; public class cerc { double raza; cerc() { raza = 0; }
7 Views
no comments
/* Parvulescu Cosmin Grupa 202 carte.java */ package Mostenire_Carte_Manual; public class carte { private String titlu; private String autor; private String editura;
10 Views
no comments
import java.util.*; public class Chryptoscience { public static void main(String[] args) { Scanner input=new Scanner (System.in); String msg=input.nextLine(); String encmsg=""; char [] msgArray;
9 Views
no comments
//String to Array: msgArray = msg.toCharArray(); //Prints MsgArray: for(int i=0;i<msgArray.length;i++) { for(int c=0;c<characterArray.length;c++) { if(msgArray[i]==characterArray[c]) {
10 Views
no comments
import java.util.*; public class Program1 { public static void main (String []arg) { Random gen=new Random(); int sum=0; double average;
9 Views
no comments
import java.util.*; public class MyArrayMethods { int [] arr; String arrVals=""; public MyArrayMethods(int arraySize) { int [] array = new int[arraySize]; arr=array;
9 Views
no comments
import java.util.*; public class Program2 { public static void main (String []arg) { int arraySize=10; Scanner input = new Scanner(System.in);
11 Views
no comments
<pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:583)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
15 Views
no comments
GraphicsWindow w = DettaHarDuSenInnan;
int i = 5 // bara exempel, kör med 5 turtles
RaceTurtle[] turtles = new RaceTurtle[i];
Random r = new Random();
for(int k = 0;k<i;k++){
int typAvTurtle = r.nextInt(4);
int startNumber = k;
int x,y = DessaRäknarDuUtSomVanligt;
switch(typAvTurtle){
case 0:turtles[k] = new RaceTurtle(w, x, y, startNumber);
11 Views
no comments
package turtlerace; import java.util.Random; import se.lth.cs.pt.die.Die; import se.lth.cs.pt.graphics.basic.GraphicsWindow; import se.lth.cs.pt.turtle.visible.Turtle; class RaceTurtle extends Turtle {
12 Views
no comments
package javaapplication7; import se.lth.cs.pt.io.*; import java.util.*; public class Main { static Register r = new Register(10); public static void main(String[] args) {
10 Views
no comments
@Override public boolean equals(Object obj) { Entry e = (Entry)obj; return (this.destination == e.destination && this.outgoing == e.outgoing); }
10 Views
no comments
import java.util.Hashtable; public class Puzzle { public static void main( String args[] ) { Hashtable<String, Integer> d = new Hashtable<String, Integer>(); int v[] = {0,1,2,3,4,5,6,7,8,9}; for( int i = 0; i < v.length; i++ )
8 Views
no comments
package screens; import java.awt.BorderLayout; import java.awt.Component; import java.awt.GridLayout; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel;
10 Views
no comments
public class OracleJdbcTest { String driverClass = "oracle.jdbc.driver.OracleDriver"; Connection con; public void init(FileInputStream fs) throws ClassNotFoundException, SQLException, FileNotFoundException, IOException { Properties props = new Properties(); props.load(fs); String url = props.getProperty("db.url"); String userName = props.getProperty("db.user");
12 Views
no comments
import java.util.Scanner; public class BankDispenser { static Scanner scan = new Scanner(System.in); static Account account1=new Account( 1000, "Svensson Dan", 1111); static Account account2=new Account( 2000, "Stålhandske Håkan", 2222); public static void main(String[] args) {
17 Views
no comments
//******************************************************* // Account.java // // A bank account class with methods to deposit to, withdraw from, // change the name on, charge a fee to, and print a summary of the account. // !!Note that you won't be able to test your methods until you write ManageAccounts in question #2.!! //******************************************************* public class Account {
12 Views
no comments
int x = 5; int y = 8; int xCompare = 5; int yCompare = 8; if (y < yCompare) { if (x < xCompare) { System.out.print("@@"); }
11 Views
no comments
int x = 5; int y = 8; int xCompare = 5; int yCompare = 8; if (y < yCompare) { if (x < xCompare) System.out.print("@@"); } else
11 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
