Bidvertiser

Tampilkan postingan dengan label java. Tampilkan semua postingan
Tampilkan postingan dengan label java. Tampilkan semua postingan

Minggu, 03 April 2011

Magnetic Joe 2

Magnetic Joe 2
Screen Size: 128x128, 128x160, 176x220, 240x320

In Magnetic Joe you control a bit magnetic sphere called Joe. By making him magnetic or not you'll help him evade obstructions and reach the exits. When Joe is magnetic, he will be drawn by the various metal objects on the levels, thus you can help him evade the obstacles and glide to the exits. There are fifty levels in three different environments in the game, but you'll also be able to download an infinite number of new levels from the Internet by using codes.

Download Free Java Games

Zombie Infection by Gameloft

Zombie Infection by GameloftScreen Size: for Nokia 5800, for Nokia N95, 128x128, 128x160, 176x208, 176x220, 208x208, 240x320, 320x240, 352x416

Zombie Infection NY, 2011 A.D. Zombies you're part of the “Inside the Action” team and while policing, you realize that a virus was released… that changes people into dangerous creatures… Save New York City from bloodthirsty zombies, as a military officer, a news reporter, and a hand-to-hand combat specialist. Apply all the awesome weapons at your disposal: Rocket launcher, Katana, Grenades, Laser Gun, Machine Gun and more to complete your assignments. Kill 100s of zombies and complete thirty-six missions to save the world and become a hero! Save New York from a virus attack that turns people into bloodthirsty zombies.

Features:- A frightening universe: Escape a post apocalyptic NY ravaged with a virus that changes people into frightening & angry zombies.
- Intense stealth action: Use the lights & shadows to avoid or attract & kill zombies allergic to light or dark.
- Play with the environment: Break & go through walls, burn trees in your way, etc.
- New semi-automatic shooting system: for a more accurate shooting experience.
- Enhanced graphic engine that can display several dozens of zombies on the same screen.
- Play with 3 different characters: a officer, a news reporter & a hand-to-hand combat specialist.

Download Free Java Games

PDC World Darts Championship

PDC World Darts Championship
Screen Size: 176x208, 240x320 s60

In PDC World Darts Championship you must come out to the oche and take the challenge against the world's top players including Phil Taylor, James Wade, John Part and more in the honestest darts game ever. Competing against the AI players across each of the 3 world tourneys will be a real challenge; can you hold your nerve and become the champion?

Download Free Java Games

N.O.V.A. Near Orbit Vanguard Alliance


Screen Size: 176x208, 176x220, 240x320, 352x416, 360x640

You are Kal Wardin, the hero of an elite military force, the Near Orbit Vanguard Alliance, or N.O.V.A., established to protect humanity from alien threats. Now you are called out of retirement to end a new war! Evolve in an intense, fast-paced side-view sci-fi action game. Find your way out of locked rooms to go forward. Get upgrades with special abilities and weapons. Defeat legions of enemies and battle powerful bosses throughout the futuristic game world, with hours of intense game play unlike anything on mobile!

Download "N.O.V.A. Near Orbit Vanguard Alliance" Java Game

Ultimate Mortal Kombat 3


Screen Size: 128x160, 176x208, 176x220, 240x320, 240x400, 320x240, 360x640, 480x640

The arcade classic hits mobile for the first time! Relive the furious fast-paced fun of arcade-style combat with this retro reproduction of the definitive Mortal Kombat game. Featuring up to 7 iconic MK characters, perform key combos and finishing moves in up to 5 authentic arenas, backed by original sound effects and fist-pumping music. Dual control settings plus 3 difficulty levels deliver awesome action for hardcore and casual gamers alike. The ultimate in arcade kombat is back!

Download "Ultimate Mortal Kombat 3" Java Game

Jumat, 01 April 2011

Demonstrate multiple catch statements.

 
class MultiCatch {
  public static void main(String args[]) {
    try {
      int a = args.length;
      System.out.println("a = " + a);
      int b = 42 / a;
      int c[] };
      c[4299;
    catch (ArithmeticException e) {
      System.out.println("Divide by 0: " + e);
    catch (ArrayIndexOutOfBoundsException e) {
      System.out.println("Array index oob: " + e);
    }
    System.out.println("After try/catch blocks.");
  }
}

Using a Formatter Object to Load a Buffer

 
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.channels.FileChannel;
import java.util.Formatter;

public class MainClass {
  public static void main(String[] args) {
    String[] phrases = "A""B 1""C 1.3" };
    String dirname = "C:/test";
    String filename = "Phrases.txt";
    File dir = new File(dirname);
    File aFile = new File(dir, filename);
    FileOutputStream outputFile = null;
    try {
      outputFile = new FileOutputStream(aFile, true);
    catch (FileNotFoundException e) {
      e.printStackTrace(System.err);
    }
    FileChannel outChannel = outputFile.getChannel();
    ByteBuffer buf = ByteBuffer.allocate(1024);
    System.out.println(buf.position());
    System.out.println(buf.limit());
    System.out.println(buf.capacity());
    CharBuffer charBuf = buf.asCharBuffer();
    System.out.println(charBuf.position());
    System.out.println(charBuf.limit());
    System.out.println(charBuf.capacity());
    Formatter formatter = new Formatter(charBuf);
    int number = 0;
    for (String phrase : phrases) {
      formatter.format("%n %s", ++number, phrase);
      System.out.println(charBuf.position());
      System.out.println(charBuf.limit());
      System.out.println(charBuf.capacity());
      charBuf.flip();
      System.out.println(charBuf.position());
      System.out.println(charBuf.limit());
      System.out.println(charBuf.length());
      buf.limit(* charBuf.length())// Set byte buffer limit
      System.out.println(buf.position());
      System.out.println(buf.limit());
      System.out.println(buf.remaining());
      try {
        outChannel.write(buf);
        buf.clear();
        charBuf.clear();
      catch (IOException e) {
        e.printStackTrace(System.err);
      }
    }
    try {
      outputFile.close();
    catch (IOException e) {
      e.printStackTrace(System.err);
    }
  }
}

int array to byte array

 
 
 
/*
 * Permission is hereby granted, free of charge, to any person obtaining a copy of 
 * this software and associated documentation files (the "Software"), to deal in 
 * the Software without restriction, including without limitation the rights to 
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
 * of the Software, and to permit persons to whom the Software is furnished to do
 * so, subject to the following conditions:
 
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
 * SOFTWARE.
 */

public class ArrayCopy {

    
  public static byte[] int2byte(int[]src) {
    int srcLength = src.length;
    byte[]dst = new byte[srcLength << 2];
    
    for (int i=0; i<srcLength; i++) {
        int x = src[i];
        int j = i << 2;
        dst[j++(byte) ((x >>> 00xff);           
        dst[j++(byte) ((x >>> 80xff);
        dst[j++(byte) ((x >>> 160xff);
        dst[j++(byte) ((x >>> 240xff);
    }
    return dst;
}
}

Bidvertiser