Is there elseif in java??

is there elseif in java??

Seriously on Java Tiger revision they are implementing the import static.
This will allow, for example to do:import static java.lang.Math.*;or something like that.
That will allow lazy coders, like me :), to skip some repeting names.
Instead of doing:Math.pow(x, Math.sqrt(x)*Math.log(x));this:pow(x, sqrt(x)*log(x));Convenient and readable, huh?

Similar Messages

  • Fedora 13: After upgrading from FF3.6 to FF6.0.2 I no longer have a Java plugin. How do I configure the Java Plugin for FF 6 ? There is no Java Plugin at the site

    I am Fedora 13x64 bit. I just installed FF v6.0.2 from the FF download site. I backed up the existing FF 3.6 as firefox_old
    I need to have a Java plugin to access company site, how do I configure the Java Plugin ?
    At the Plugin area in FF6 there is no Java Plugin available, even after a search.
    I have Java 1.6.0 installed in the OS at:
    /usr/lib/jvm/java-1.6.0/jre/lib/amd64/libnpjp2.so
    I googled how to configure Java Plugin for FF 6 for Fedora 13 and the trick was to create a soft link from /home/<userID>/.mozilla/plugins to the above libnpjp2.so

    AVtech wrote:
    . . . If a person can't get an answer here I don't know where else to turn since Sun certainly wouldn't offer tech support for a free product . . .These forums are user forums, and only occasionally visited by Sun employees. Sun does provide Java technical support options, although (of course) at a charge.
    See:
    http://developers.sun.com/services/
    . . . I guess we'll just use JRE 5 until it's unsupported, whenever that will be. I'm still waiting for an answer on that question, too. See:
    http://java.sun.com/products/archive/eol.policy.html
    http://www.sun.com/service/eosl/
    This document (part IV and Appendix) has some debugging and troubleshooting information that may allow someone involved in the problem to resolve the cause:
    See:
    http://java.sun.com/javase/6/docs/technotes/guides/plugin/developer_guide/contents.htm
    Any steps that you can take to isolate the problem to specific Java versions, browsers, applets, web sites, operating systems (and versions), etc, would enhance the possibility of getting help.
    You can try the applets at this Sun location and see if any of them are "slow".
    See:
    http://java.sun.com/javase/6/docs/technotes/samples/demos.html

  • Is There A Pure Java Solution?

    Is there a pure Java solution for a servlet to create
    a popup window? In other words, is there a Java solution
    for creating a new window with Java code inside the
    doPost() method?

    Try setting
    response.setContentType("text/html");
    response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);
    and stream html with javascript to pop a window. Don't have code right now...but try to search in this direction. Sure you can do...I will post the code if I find..
    -

  • How many classes are there in the java kit?

    i figured this was the most "general" forum to post this question in. and im curious to know, how many packages/classes/functions are there in the java sdk? like, all the prebuilt ones. ive looked but cant seem to find any info on it. anybody happen to know?
    Thanks!

    there are at least 4142 classes in the 1.4.2.x distribution ...Is that the number of files which end in .java? There's bound to be a lot more
    classes, when you u consider inner classes and especially anonymous
    inner classes.It was just a rough estimation ... and I wrote 'at least' 4142 classes ...
    and I was wrong: there are alse 4 .h files in the src.zip file, so that makes 4138
    classes at least :-)
    kind regards,
    Jos

  • Is there a free java based forum that does NOT require disk write access ?

    Hello,
    I've been trying to set up mvnForum (www.mvnForum.com) on my site but I've had to give it up as the way the server is set up I can only give write access to Tomcat if I give write access to everyone !
    I don't need my forum to have disk access as it can just use the mySQL database the whole time. So is there a good java based forum out there that does not require disk access ? I'm hoping to find one that has e-mail authentication for people who register and things like that.
    I know a php forum that will do it already but as the rest of the site is written in jsp it would be nice to be able to integrate it properly. Any help greatly appreciated.

    Please try mvnForum beta3, it doesnot require disk write. Since RC1 mvnForum use disk access to write Lucene search index and attachment file.
    Regards,
    Minh Nguyen
    mvnForum Developer

  • I am in the process of doing a Proof Of Concept / Evaluating products that can help us build a Java Application to Convert a PDF document to a Searchable PDF.   I wanted to check is there any simple JAVA API from Adobe to achive this ? Any direction in th

    I am in the process of doing a Proof Of Concept / Evaluating products that can help us build a Java Application to Convert a PDF document to a Searchable PDF. 
    I wanted to check is there any simple JAVA API from Adobe to achive this ? Any direction in this regard is greatly appreciated.@

    You can achieve this using LiveCycle PDF Generator JAVA API. You can find required code here:
    Adobe LiveCycle * Quick Start (SOAP mode): Converting a Microsoft Word document to a PDF document using the Java API
    In parameters:
    //Set createPDF2 parameter values
    String adobePDFSettings = "Standard";
    String securitySettings = "No Security";
    String fileTypeSettings = "Standard OCR";
    "Standard OCR" file type setting will run OCR on input pdf. In the code, instead of doc file provide a pdf file. Resultant pdf will be searchable PDF i.e OCRed PDF.
    Feel feel to ask any further questions.

  • Is there any pure Java OS for PC ?

    When i testing programe with applet, i found that the performance is not good at all, i think that if there pure native java os here, i can run directly with my class file, is it already be true ?

    i dont think anyone can write an OS purely in java.You are wrong. Mainly because the question isn't very specific. I had the same opinion until someone in another thread convinced me. The solution is not the one you are thinking of. Search for the thread and read the entire thing.
    first question to answer is How good is java's IO? is
    it atleast half as good as that of C? No.Huh? Many implementations that use the Java API library could be improved if the authors took time to write a bettern implementation specific to their library. Or in some cases just used the API correctly in the first place. There is at least one magazine article that points this out.

  • Is there any core java tutorial form sun site

    HI all,
    is there any core java tutorial form sun site where i can down load it study them on offline rather that seeing it on line.
    can any give me link for it.........
    vijay

    thank you for reply ,
    i have googled and find this help full in getting the details and u can download from here.
    "http://java.sun.com/docs/books/tutorial/information/download.html"
    vijay

  • ResultWaiter, is there any in java standard API

    I need a class like the following for "synchronizing" asynchronus results.
    public class ResultWaiter {
       private Object lock;
       private Exception ex;
       private Object result;
       public ResultWaiter() {
          lock = new Object();
          result= null;
          ex = null;
       public Object getResult() throws Exception {
          if (result == null) {
             synchronized (lock) {
                try {
                   lock.wait(5000);
                } catch (InterruptedException ex) {}
          if (result== null && ex == null) {
             throw new Exception("A timeout occured ");
          if (result != null) {
             return result;
          throw ex;
       public void handleResult(Object result) {
          synchronized (lock) {
             this.result= result;
             lock.notifyAll();
       public void handleError(Exception ex) {
          synchronized (lock) {
             this.ex = ex;
             lock.notifyAll();
    }Is there a class which provides this behaviour in the Java APIs or do I need to write it myself?

    java.util.concurrent.Future
    java.util.concurrent.FutureTask?

  • Will there be a java security update for OS 10.7/10.8 users like the one for OS 10.6 users (update 12) ?

    There is a security risk for all 10.7/10.8 users according to Oracle.  When will we get a resoltuion and/or recommendation for the vunerablilities found in the Java version 1.6.0.37?

    When will we get a resoltuion and/or recommendation for the vunerablilities found in the Java version 1.6.0.37?
    There will never be a permanent resolution. Java is inherently insecure by design.
    Java on the Web (not to be confused with JavaScript, to which it's not related, despite the similarity of the names) is a weak point in the security of any system. Java is, among other things, a platform for running complex applications in a web page, on the client. That was never a good idea, and Java's developers have had a lot of trouble implementing it without also creating a portal for malware to enter. Past Java exploits are the closest thing there has ever been to a Windows-style "virus" affecting OS X. Merely loading a page with malicious Java content could be harmful. Fortunately, Java on the Web is mostly extinct. Only a few outmoded sites still use it. Try to hasten the process of extinction by avoiding those sites, if you have a choice.
    Java is not included in OS X 10.7 and later. Discrete Java installers are distributed by Apple and by Oracle (the developer of Java.) Don't use either one unless you need it. Most people don't. If Java is installed, disable it — not JavaScript — in your browsers. In Safari, this is done by unchecking the box marked Enable Java in the Security tab of the preferences dialog.
    Regardless of version, experience has shown that Java on the Web can't be trusted. If you must use a Java applet for a specific task, enable Java only when needed for the task and disable it immediately when done. Close all other browser windows and tabs, and don't visit any other sites while Java is active. Never enable Java on a public web page that carries third-party advertising. Use it only on well-known, password-protected, secure websites without ads. In Safari 6 or later, you'll see a lock icon in the address bar with the abbreviation "https" when visiting a secure site.

  • Is there anyone using Java Methods interface of IREP in his application

    Hello everyone,
    Are you using Java Methods interface of IREP in your application?
    Nowadays I am trying to using Java Methods in my application. But I'm puzzled how to get the interface jar files that the Java Methods would import. It seems that Oracle doesn't provide such interface jar files for all Java Methods shipped in IREP. How do you do with this?
    If you have some experience about using Java Methods in application, hope to hear your voice. Thanks in advance.

    Hi friend,
    Thanks for you update.
    I'm referring to Java Methods that can be called directly by applications not Java Service Interface. These are two different kinds of IREP interfaces. In Oracle Integration Repository User's Guide, there aren't much guidance about how to use Java Methods.
    I appreciate you can help me further.

  • Is there a viable JAVA alternative?

    Hello
    I would like to know if there is a viable and usable alternative to JAVA. Every time there is an Oracle update to Java, it seems to attract the Hackers who attack it, followed by another Java 'Fix' which does not work. I appreciate the work FireFox has done to work around this problem, but would like to know if there are alternative programmes out there which could break the Java circle.

    Unfortunately, none that I know of. The best advice I can give you is to disable java unless you need it for a mission critical task, then only enable it for that then disable it again.

  • I am using oracle Apps ERP in firefox wherein there is a Java Plugin , This is working fine in 3.5 version but as soon as i am upgrading to the latest version oracle is not working and firefox crashes. I can't upgrade even though i wish to

    We are using Oracle ERP in our company which is a web based ERP system. I am using firefox to work in ERP for convinieince pf working and using internet at the same time. This requires a plugin provided by oracle oajinit.exe to be installed in Plugins it is a JAVA plugin which opens the ERP Screens. This works fine in versions prior to 3.6 version of firefox. However, after upgrading to 3.6 version the forms do not open and firefox crashes. Due to this i am not able to upgrade to the latest version else i'll have to operate the ERP in internet explorer and using firefox for browsing which i do not want. The plugin used for the ERP is "* JInitiator 1.3.1.18 for Netscape Navigator (DLL Helper)"

    Firefox 3.6 needs the Java Second Generation Plugin which comes with newer versions than 1.6.0_03 - update Java, the latest version is 1.6.0_22

  • There is no java virtual machine in Mountain Lion?

    I try to access a .jar file typing "java -jar <file name> in Terminal, but I received the following message:
    "Could not create the Java virtual machine"
    Some help, please.

    OK, David, thank you very much. The default version is Java 6, but Java 7 appears as the version to be used with Safari and Firefox (but not with Chrome, as this one is 32 bit based).
    One can see that version 7 is installed in the System Preferences, as shown in the window.
    How do I know if I have Java installed on my Mac?
    Mac OS X 10.6 and below: Apple's Java comes pre-installed with your Mac OS.
    Mac OS X 10.7 (Lion) and above: Java is not pre-installed with Mac OS X versions 10.7 and above. To get the latest Java 7 from Oracle, you will need Mac OS X 10.7.3 and above.
    If you have Java 7, you will see a Java icon under System Preferences.
    Java versions 6 and below are listed in the Java Preferences.app located in the Applications > Utilities folder on your Mac.

  • Is there Session in java's webservice?

    I wanna store my database connection in a global variable,
    for example, a Session or an Application,
    what can I do?

    Thank you very much!
    I search a java file named DBConnectionManager.java which could do the job.
    The source code is below:
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import java.util.Date;
    //����DBConnectionManager
    public class DBConnectionManager {
    static private DBConnectionManager instance;
    static private int clients;
    private Vector drivers = new Vector();
    private PrintWriter log;
    private Hashtable pools = new Hashtable();
    //��������������
    static synchronized public DBConnectionManager getInstance() {
    if (instance == null) {
    instance = new DBConnectionManager();
    clients++;
    return instance;
    //����������
    private DBConnectionManager() {
    init();
    //������������
    //������������
    public void freeConnection(String name, Connection con) {
    DBConnectionPool pool = (DBConnectionPool) pools.get(name);
    if (pool != null) {
    pool.freeConnection(con);
    //����������������
    //������������
    public Connection getConnection(String name) {
    DBConnectionPool pool = (DBConnectionPool) pools.get(name);
    if (pool != null) {
    return pool.getConnection();
    return null;
    public Connection getConnection(String name, long time) {
    DBConnectionPool pool = (DBConnectionPool) pools.get(name);
    if (pool != null) {
    return pool.getConnection(time);
    return null;
    //����getconnection
    //������������
    public synchronized void release() {
    if (--clients != 0)
    return;
    Enumeration allPools = pools.elements();
    while (allPools.hasMoreElements()) {
    DBConnectionPool pool = (DBConnectionPool) allPools.nextElement();
    pool.release();
    Enumeration allDrivers = drivers.elements();
    while (allDrivers.hasMoreElements()) {
    Driver driver = (Driver) allDrivers.nextElement();
    try {
    DriverManager.deregisterDriver(driver);
    log("����JDBC��������" + driver.getClass().getName());
    catch (SQLException e) {
    log(e, "��������JDBC��������������" + driver.getClass().getName());
    private void createPools(Properties props) {
    Enumeration propNames = props.propertyNames();
    while (propNames.hasMoreElements()) {
    String name = (String) propNames.nextElement();
    if (name.endsWith(".url")) {
    String poolName = name.substring(0, name.lastIndexOf("."));
    String url = props.getProperty(poolName + ".url");
    if (url == null) {
    log("����������" + poolName + "������URL");
    continue;
    String user = props.getProperty(poolName + ".user");
    String password = props.getProperty(poolName + ".password");
    String maxconn = props.getProperty(poolName + ".maxconn", "0");
    int max;
    try {
    max = Integer.valueOf(maxconn).intValue();
    catch (NumberFormatException e) {
    log("������������������" + maxconn + ".������" + poolName);
    max = 0;
    DBConnectionPool pool = new DBConnectionPool(poolName, url, user,
    password, max);
    pools.put(poolName, pool);
    log("��������������" + poolName);
    private void init() {
    InputStream is = getClass().getResourceAsStream("/db.properties");
    Properties dbProps = new Properties();
    try {
    dbProps.load(is);
    catch (Exception e) {
    System.err.println("������������������������db.properties������CLASSPATH��");
    return;
    String logFile = dbProps.getProperty("logfile", "DBConnectionManager.log");
    try {
    log = new PrintWriter(new FileWriter(logFile, true), true);
    catch (IOException e) {
    System.err.println("������������������" + logFile);
    log = new PrintWriter(System.err);
    loadDriver(dbProps);
    createPools(dbProps);
    private void loadDriver(Properties props) {
    String driverClasses = props.getProperty("drivers");
    StringTokenizer st = new StringTokenizer(driverClasses);
    while (st.hasMoreElements()) {
    String driverClassName = st.nextToken().trim();
    try {
    Driver driver = (Driver) Class.forName(driverClassName).newInstance();
    DriverManager.registerDriver(driver);
    drivers.addElement(driver);
    log("����������������" + driverClassName);
    catch (Exception e) {
    log("����������������:" + driverClassName + ",����" + e);
    private void log(String msg) {
    log.println(new Date() + ":" + msg);
    private void log(Throwable e, String msg) {
    log.println(new Date() + ":" + msg);
    e.printStackTrace(log);
    class DBConnectionPool {
    private int checkOut;
    private Vector freeConnections = new Vector();
    private int maxconn;
    private String name;
    private String password;
    private String URL;
    private String user;
    public DBConnectionPool(String name, String URL, String user,
    String password, int maxconn) {
    this.name = name;
    this.URL = URL;
    this.password = password;
    this.user = user;
    this.maxconn = maxconn;
    public synchronized void freeConnection(Connection con) {
    freeConnections.addElement(con);
    checkOut--;
    notifyAll();
    public synchronized Connection getConnection() {
    Connection con = null;
    if (freeConnections.size() > 0) {
    con = (Connection) freeConnections.firstElement();
    freeConnections.removeElementAt(0);
    try {
    if (con.isClosed()) {
    log("��������" + name + "������������");
    con = getConnection();
    catch (SQLException e) {
    log("��������" + name + "������������");
    con = getConnection();
    else if (maxconn == 0 || checkOut < maxconn) {
    con = newConnection();
    if (con != null) {
    checkOut++;
    return con;
    public synchronized Connection getConnection(long timeout) {
    long startTime = new Date().getTime();
    Connection con;
    while ( (con = getConnection()) == null) {
    try {
    wait(timeout);
    catch (InterruptedException e) {}
    if ( (new Date().getTime() - startTime) >= timeout) {
    return null;
    return con;
    public void release() {
    Enumeration allConnections = freeConnections.elements();
    while (allConnections.hasMoreElements()) {
    Connection con = (Connection) allConnections.nextElement();
    try {
    con.close();
    log("����������" + name + "��������");
    catch (SQLException e) {
    log(e, "��������������" + name + "��������");
    freeConnections.removeAllElements();
    private Connection newConnection() {
    Connection con = null;
    try {
    con = DriverManager.getConnection(URL, user, password);
    log("������" + name + "����������������");
    catch (SQLException e) {
    log(e, "������������URL������" + URL);
    return null;
    return con;
    }

Maybe you are looking for