Java Puzzlers

Potyczki z Javą
  • Home
  • O stronie
  • Kontakt

Archiwum

Posty oznaczone ‘round’

Ground Round

15 marca, 2011 rafos 1 komentarz

Dziś zagadka „matematyczna” 🙂

  • Jak często poniższy kod wypisze Ground Round?
import java.util.*;
public class UrlSet {

  public static void main(String[] args) {
      Random rnd = new Random();
      int i = rnd.nextInt();
      if (Math.round(i) != i) {
        System.out.println("Ground Round");
      }
  }
} 

Czytaj więcej…

Kategorie:Java Puzzle Tagi:int, Math, nextInt, random, round
RSS
  • Google
  • Youdao
  • Xian Guo
  • Zhua Xia
  • My Yahoo!
  • newsgator
  • Bloglines
  • iNezha

Random Posts

  • I love the String class!
  • Time Flows
  • JavaPuzzlers
  • Witaj na JavaPuzzlers.pl
  • Elvis Lives Again

Tag Cloud

add append ArrayList Arrays asList assertEquals boolean Byte compound operator Date enum final HashSet int integer InterruptedException join JUnit List Long Math nextBoolean nextInt NullPointerException number Object random reflection remove round Runnable RuntimeException Set Short Singleton pattern size start static static import String StringBuffer ternary operator TestCase Thread varargs

Categories

  • Info
  • Java Puzzle

Blogroll

  • BlackBeltFactory.com
  • Blog IT – Rafał Roppel
  • JavaChamp.com
  • JavaCzyHerbata.pl
  • JavaPassion.com
  • JavaPuzzlers.com
  • JavaRanch.com
  • Praktyczne podejście do projektowania systemów dużej skali

Archives

  • marzec 2012
  • październik 2011
  • lipiec 2011
  • czerwiec 2011
  • maj 2011
  • marzec 2011

Meta

  • Zaloguj się
Góra WordPress
Copyright ©2011-2012 Java Puzzlers
Theme by NeoEase. Valid XHTML 1.1 and CSS 3.