New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
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(); 
Yesterday @ 7:34am
Tags:
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
by ludjer   Wednesday @ 3:39pm
Tags:
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;
by ludjer   Wednesday @ 3:38pm
Tags:
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);
Wednesday @ 12:28pm
Tags:
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(); 
Tuesday @ 5:50am
Tags:
10 Views
no comments
 
/* Parvulescu Cosmin
   Grupa 202
   cerc.java */
 
package Mostenire_Cerc_Cilindru;
 
public class cerc {
    double raza;
 
    cerc()                      { raza = 0; }
by Parvulescu Cosmin   March 05, 2010 @ 5:36pm
Tags:
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;
by Parvulescu Cosmin   March 05, 2010 @ 5:34pm
Tags:
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;
        
March 02, 2010 @ 7:17am
Tags:
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])
      {
March 02, 2010 @ 6:30am
Tags:
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;
March 02, 2010 @ 5:49am
Tags:
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;
March 02, 2010 @ 5:11am
Tags:
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);
 
        
March 02, 2010 @ 5:10am
Tags:
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)
March 01, 2010 @ 7:01pm
Tags:
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);
by Björn Granberg   March 01, 2010 @ 9:12am
Tags:
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 {
by Björn Granberg   March 01, 2010 @ 9:03am
Tags: 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) {
March 01, 2010 @ 4:40am
Tags:
10 Views
no comments
 
@Override
public boolean equals(Object obj) {
   Entry e = (Entry)obj;
   return (this.destination == e.destination && this.outgoing == e.outgoing);
}
February 28, 2010 @ 3:24pm
Tags:
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++ )
February 26, 2010 @ 3:05am
Tags:
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;
February 25, 2010 @ 5:19am
Tags:
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"); 
by vwarship   February 24, 2010 @ 6:39pm
Tags: java, jdbc, oracle
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) 
    { 
February 24, 2010 @ 6:28am
Tags:
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 
{ 
February 24, 2010 @ 6:26am
Tags:
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("@@");
    }
February 23, 2010 @ 12:23pm
Tags:
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
February 23, 2010 @ 12:21pm
Tags:
11 Views
no comments
 
package inlämning5;
 
import se.lth.cs.pt.dots.basic.DotWindow.*;
import se.lth.cs.pt.dots.events.*;
import se.lth.cs.pt.dots.*;
import java.util.*;
 
public class Main {
 
    DotWindow w;
February 22, 2010 @ 12:18pm
Tags:
14 Views
no comments
 
brought to you by:
West Wind Techologies


If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate