Java tutorial
//package com.java2s; public class Main { public static int displayHeight; private static int designHeight; public static int getDisplayHeightValue(int designHeightValue) { if (Math.abs(designHeightValue) < 2) { return designHeightValue; } return designHeightValue * displayHeight / designHeight; } }