Hello...Java is supporting mutiple datatypes declarations in for loop

hello,
is it possible to declare more than one data types in a for loop...i think java is supporting multiple declarations in for loop..am i right
class check
     public static void main(String[] args)
          for(int i=10,float k=10;i<5;i++)
               System.out.println("Hello World!"+i);
regards,
j.mouli

Hi,
no, that doesn't work because java unlike c++ does not
have the comma operator ",". So you need to declare
the 2nd variable in the body of the loopNot strictly correct - its true that it won't work in this case, but false that Java doesn't recognise the comma.
If your two variables were of the same type you could use something like
for (int i = 0, k = 10; i < k; i++)
However, the initialisation must take place in a single statement, so you can't use multiple types

Similar Messages

  • Does java card support PIN encryption on APDU Verify Command???

    hello
    I want to know if java card allows PIN encryption in the APDU verify command? because such an action necessits that a section key has to be set between the server (SC applet) and the client application.
    thanks a lot

    Many Java cards support the GlobalPlatform Open Platform specification
    which can be downloaded for free from http://www.globalplatform.org .
    This specification contains a mechanism called "secure messaging".
    All APDUs sent to applications or the cardmanager and the corresonding
    responses can be enrypted when using secure messaging.
    In order to use secure messaging a "mutual authentication" is necessary
    where the off-card entity authenticates itself to an application,
    e.g. the card manager, and the application authenticates itself to the
    off-card entity.
    Naturally, this involves static keys on/off-card and session keys.

  • Problem Running Hello.java

    Hi All,
    I am facing problem to run Hello.java.
    The following exception accurs when I try to run it.
    java.lang.RuntimeException: RegOpenKeyEx: The system cannot find the file specified. (2)
         at com.ibm.speech.recognition.RecoImpl.initialize(Native Method)
         at com.ibm.speech.recognition.RecoImpl.<init>(RecoImpl.java:163)
         at com.ibm.speech.recognition.RecoImpl.make(RecoImpl.java:103)
         at com.ibm.speech.recognition.IBMEngineCentral.makeModes(IBMEngineCentral.java:112)
         at com.ibm.speech.recognition.IBMEngineCentral.createEngineList(IBMEngineCentral.java:179)
         at javax.speech.Central.availableRecognizers(Central.java:455)
         at javax.speech.Central.createRecognizer(Central.java:343)
         at hello.Hello.main(Hello.java:170)
    java.lang.NullPointerException
         at hello.Hello.main(Hello.java:171)
    Can any body tell me what should I do.
    Thanks in advance,
    Regards,
    Haider Ali

    The solution is simple, but only once have I seen it up in the forums, so I am on a campaign to put it in a couple more places.
    Solution: download the via voice runtime from IBM's Alphaworks website. I don't have the link handy, but it is pretty easy to find. Something like http://alphaworks.ibm.com.
    Just make sure you not only get all of the SDKs and such, but also the ACTUAL runtime. They say something about needing the runtime on the download page, but it is in the fine print. It is 'VVRTDUS10.ZIP' and is around 170MB or so. Once installed, if you still have a problem, try putting the 'bin' directory in the via voice folder in your PATH (not CLASSPATH) environment variable.
    That did the trick for me.
    Bye now.

  • Java 7 support for LMS 4.2?

    Any idea if LMS 4.2 is going to get support for Java 7?  Java 6 reaches end of Public Updates February 2013.
    http://www.oracle.com/technetwork/java/eol-135779.html

    I don't have any inside information but would strongly expect an update to LMS in 2013 that will introduce Java 7 support.
    For now, though, you are best advised to stick with the supported Java 6. LMS has gotten better in tolerating minor updates; but I have yet to see anyone get LMS working completely with Java 7.

  • Exception in thread "main" java.lang.NoClassDefFoundError: Hello/java

    I installed jdk 1.5 on my windows XP SP2 system and tried to run a simple program:
    public class Hello {
         public static void main(String[] args) {
              System.out.println("Hello world!!");
    }     but i get the following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: Hello/java
    I've set the classpath as:
    CLASSPATH=C:\Java\jdk1.5.0_09\lib;
    and path variableas:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\WBEM;%SYSTEMROOT%\system32\WBEMC:\PROGRA~1\COMMON~1\AUTODE~1;C:\Java\jdk1.5.0_09\bin;c:\j2sdkee1.3.1\bin;c:\Java\jdk1.5.0_09\lib;
    I didn't have this problem when i was using SP1 of windows xp...
    Plz help!!

    Oh!! I didn't know this was a famous question of this forum!!
    Just added a semi-colon at the end of classpath and it works fine.... although a strange solution

  • Best combination of technologies for Java db-supported web application?

    Hi everyone!
    I was given the task to develop a Java database-supported web application and am now wondering what combination of technologies would best fit my requirements.
    Basically, I am supposed to transform an "Excel-based" application into a Java-based web application that can be run in a browser in our intranet (I know, that's what a web application is supposed to do).
    The Excel application consist of an Excel sheet that holds all the data and a VBA form, that shows and lets you edit all the details/fields of a row and lets you navigate through the rows. Furthermore there are certain macros to filter the data table.
    Now, to transform the application, all data from Excel will be moved to an Oracle relational database and I want to rebuild the functionality with Java.
    Consequently, the Java application is intended to...
    - output the table as is in the browser
    - easily let you filter the data of the table
    - let you create (and save) custom filters
    - show detail view of a row
    - navigate through the rows of the (filtered) table
    - save the data that is entered/edited/deleted in the detail view back to the table in the database
    So, what are the best (and easiest to use) tools and technologies to develop such an application?
    Currently my reasearch has led me to the following conclusions:
    *1.* Architecture: I need a three-tier client-server application, which lead us to using the J2EE platform, right?
    *2.* For the persistence layer I somehow have to map the database table to a Java object,
    - either doing it completely manually (coding) using JDBC
    - or using EJB3 / Java Persistence API / Hibernate to get at least the getters and setters auto-generated, right?
    Please, correct me whenever i got something wrong!
    Oracle JDeveloper supports the mapping process with a wizard when using EJB3 and JPA
    (http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm)
    Is there something comparable available for Eclipse?
    *3.* I'd like to use Java Server Faces for the UI. Besides the reference implementation there are several other implementations with additional components for e.g. displaying tables. There are:
    - Apache MyFaces Trinidad (former ADF Faces, although ADF Faces looks different/has different style sheet than Trinidad?)
    - NetBeans Visual Web tools (which look quite nice in the tutorial, but require the NetBeans IDE, I guess?! Tutorial: http://www.netbeans.org/kb/60/web/web-jpa.html
    *4.* What IDE would you recommend? Should have a WYSIWYG editor for the JSF files and should support me as much as possible as a Java Learner!
    - JDeveloper
    - Eclipse (+Plugins?)
    - NetBeans
    - MyEclipse (only if there is a free version out there, I have read about an Eclipse plug-in, but don't know if that was free...)
    *5.* Do you know some good and easy-to-understand tutorials covering this problem?
    *6.* What other aspects should I think of? Are there certain technologies for the business logic or just normal JavaBeans? What about SessionBeans and ManagedBeans?
    Any help, answers, ideas, explanations, comments, recommendations, will be highly appreciated!
    Cheers,
    Chris

    Thanks paulcw, for your quick reply and helpful comments!
    The whole thing is getting bigger than I thought...
    Actually this is a 1-man-project, that I am supposed to realise for small department during my internship in a big company.
    Maybe a more detailed description of the structure may help you to understand what I actually need.
    The table of concern, is an overview of certain projects inside the company and read-only, as it is a view on another database uniting data relevant for the department.
    Then there is a second table for additional data (specific for the department) for each project. This data has to be entered, modified, deleted with the new application, while the data from the first table is only displayed.
    1) In this case, is AJAX / JavaScript still necessarily needed?
    2) EJB and Hibernate sound like overkill to me as well, but what would be the alternatives? JDBC, SQL queries and rowSets? And are the first mentioned really so hard to use?
    3) Do you have any recommendations on how to solve the multiple access problem (I'm sure, I'm not the only one with this kind of problem...)?
    Thanks to everyone in advance!
    Chris

  • ColdFusion 9, 10 Java 7 Support ASAP!

    Oracle has released the final Java 6 Update 39 last week, marking the end of support for Java 6.  Adobe has stated multiple times that Java 7 would be supported before EOL, yet it has been a week and still no patches or update.  Does anyone have an ETA when Java 7 will be officially supported?
    References:
    Java version support     [http://forums.adobe.com/thread/975438 | http://forums.adobe.com/thread/975438]
    Java 7 support for ColdFusion    
    http://blogs.coldfusion.com/post.cfm/java-7-support-for-coldfusion
    What's the situation with #ColdFusion and Java 7, Java 6 updates, Windows 8, and OS X Mountain Lion?          [http://www.carehart.org/blog/client/index.cfm/2012/12/12/java_7_and_6_updates_and_Win8_and _MtnLion | http://www.carehart.org/blog/client/index.cfm/2012/12/12/java_7_and_6_updates_and_Win8_and _MtnLion]
    Upgrade Java for ColdFusion  http://helpx.adobe.com/coldfusion/kb/upgrading-java-coldfusion.html

    Has Adobe updated all current Java and ColdFusion KB articles yet, so I don't have to assume that when Java 7 Update 16 is released that we can apply it assuming we have the base Adobe patches that support Java ?.  I also have seen some confusing articles about JDK vs JRE, for example Ben Forta's blog post yesterday Upgrading ColdFusion To Java 7 at http://forta.com/blog/index.cfm/2013/3/3/Upgrading-ColdFusion-To-Java-7
    Ben, the Adobe website states JDK is required, not JRE "Download and install JDK 1.7." http://helpx.adobe.com/coldfusion/kb/coldfusion-10-update-8.html and "Note that ColdFusion requires the Java HotSpot Server virtual machine (jre/bin/server/jvm.dll), which is not available with the JRE download." http://helpx.adobe.com/coldfusion/kb/change-coldfusion-jvm.html
    PS +10 to Carl's question "Will CF9 or CF10 be supported on JDK 8? JDK 8 release expected September 2013?", I would like Adobe to state ColdFusion upgrade plans and timetables for new versions of Java.  Java 7 was released over 18 months ago and Java 6 received several end of life extension both without Adobe updating ColdFusion untl the last possible second!

  • Does Java DB supports JTA?

    Does anyone know if Java DB supports JTA?
    Thanks,

    If the Derby driver supports commit/rollback logic, then it can work with JTA.
    Write an transactional JDBC INSERT, throw an exception, and see if it rolls back. If it does, you're in.
    %

  • Does Java 6 support SSLIOP in Java orb?

    I have Java orb clients connect to server in TAO orb CORBA. Now I want to change the java orb clients to use SSLIOP (SSL in orb) to talk to the servers written in SSLIOP.
    The question is, does Java 6 supports SSLIOP ? if yes, where are the documents and samples I can take a look to get started.
    Thanks in advance.

    http://java.sun.com/javase/6/webnotes/features.html
    I can't see any ORB enhancements at all.
    I suspect Sun is leaving SSLIIOP for the ORB and J2EE vendors.

  • Why java does not force to declare atleast one abstract method

    hi,
    i can define an abstract class without declaring any abstract method in that class. But why wud i do this ? i mean when i have decided that a particular class should be inherited by other subclass and subclass should porvide implementation then there should be atleast one method in the abstract super class which requires implementation.
    All i want to know is why java does not force to declare atleast one abstract method in abstract class.
    there may be some situations where this restriction can create problem if it is like that then can anybody give some example.
    manish

    hi,
    i didn't get u.
    u r trying to say that i have an abstract class with
    only static methods then my questions is why wud
    declare such a class as 'abstract' class? because a
    static method can't be abstract also. Even then if
    somebody want to define such a class with only static
    methods then compiler should force him to declare
    atleast one abstract method which can be implemented
    by subclass, because as i said before if sumbody
    decide to define a class abstract then he wants that
    it should be inhereted but as u r saying a class with
    only static methods then it should not be an abstract
    class it can be a simple class.there's no functional reason, really... actually, factory-like classes are often defined the way Ceci described
    "abstract" only ensures that nobody can ever get an instance of that class (as a matter of fact, what would be the point of getting an instance, if no instance method exists ?)

  • Java.lang.IllegalStateException: can't declare any more prefixes in this co

    We are Facing the below Exception in one of the deployment environment. While in other environments we have no issues. Can anyone give pointers for the possible root cause.
    2009-01-26 10:03:25,634 WARN [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint invocation resulted in exception - responding with SOAP Fault
    java.lang.IllegalStateException: can't declare any more prefixes in this context
         at org.xml.sax.helpers.NamespaceSupport$Context.declarePrefix(Unknown Source)
         at org.xml.sax.helpers.NamespaceSupport.declarePrefix(Unknown Source)
         at com.sun.msv.verifier.AbstractVerifier.startPrefixMapping(AbstractVerifier.java:79)
         at com.sun.msv.verifier.VerifierFilter.startPrefixMapping(VerifierFilter.java:87)
         at org.iso_relax.verifier.impl.ForkContentHandler.startPrefixMapping(Unknown Source)
         at org.xml.sax.helpers.XMLFilterImpl.startPrefixMapping(Unknown Source)
         at com.sun.xml.bind.unmarshaller.InterningXMLReader.startPrefixMapping(InterningXMLReader.java:93)
         at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:218)
         at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:235)
         at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:198)
         at com.sun.xml.bind.unmarshaller.DOMScanner.parse(DOMScanner.java:87)
         at com.syfact.model.attachment.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:165)
         at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:101)
         at org.springframework.oxm.jaxb.Jaxb1Marshaller.unmarshal(Jaxb1Marshaller.java:75)
         at org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint.invoke(AbstractMarshallingPayloadEndpoint.java:87)
         at org.springframework.ws.server.endpoint.MessageEndpointAdapter.invoke(MessageEndpointAdapter.java:35)
    Thanks,

    Please note that if I provide the xml via a <c:set tag it works
    <c:set var="adapterUDMVar" value="<UDM xmlns=\"http://www.cramer.com/udm\" xmlns:udm=\"http://www.cramer.com/udm\" versionNumber=\"1.0\" generatedBy=\"Netman Aps\" source=\"ResourceManager\" UDMDateTime=\"2004-07-14T14:38:08\"/>
    Any body knows why this is happening?
    Cheers
    kk

  • Does java 2D support iamge enlarging?

    May i know whther that Java 2D enable the effect of zooming in an image?For example,zoom in part of the image to enlarge it so that we can view it more clearly??

    How about Java Advanced Imaging?Does it support also image enlarging?For example,to select part of the image and enlarge it so that we can view it more clearly?

  • How to provide support for language which java doesnt support (e.g URDU)

    Hi,
    I need to develop an application which should be using Urdu Language ,since
    java doest support URDU (language spoken in India and Pakistan).
    what steps should I take ??What to do???
    your help is really needed!
    Thanks

    Hi Abasith,
    Good day. As per our project requirment, we need to have 2 versions of Application. One in English & Arabic. Our Idea to implement Arabic is to have a properties file.(Resource bundle). But I cannot see the Arabic letters in property file created using Arabic. So we moved to Word pad & saved the document as Arabic. I am able to reach the properties. But when i use to get the string from there I m getting an exception No resource bundle found for locale.
    This is my code.
    public class Test1 {
    public static void main(String s[]){
    ResourceBundle resource_bundle; // The Resource Bundle super class
    Locale locale;
    locale = new Locale("ar","AR");
    System.out.println(locale.getCountry());
    try {
    resource_bundle = ResourceBundle.getBundle("tryone_"+locale, locale);
    //System.out.println( resource_bundle.toString());
    System.out.println("Resource Bundle here "+resource_bundle.getKeys().toString());
    Enumeration en = resource_bundle.getKeys();
    while (en.hasMoreElements()){
         System.out.println("Elements "+en.nextElement().toString());
    System.out.println(resource_bundle.getString("Myname"));
    System.out.println(resource_bundle.getLocale());
    } catch (MissingResourceException mre) {
         mre.printStackTrace(); }
    Can u help me how to go about. I am totally new to this Internationalization.
    Thanks in Advance
    kavitha

  • Java.lang.SecurityException: Cannot set up certs for trusted CAs

    Hi,
    The application iam working on encrypts & decrypts files. The application is deployed on a standalone OC4j container on solaris 5.8. I have downloaded the following jar files
    jce1_2_2.jar
    sunjce_provider.jar
    local_policy.jar
    US_export_policy.jar
    and have declared them in the application.xml
    when i run the application i get the following exception.
    java.lang.ExceptionInInitializerError: java.lang.SecurityException: Cannot set up certs for trusted CAs: java.lang.SecurityException: Signer restraint check failed! at javax.crypto.SunJCE_b.<clinit>(DashoA6275) at javax.crypto.Cipher.a(DashoA6275) at javax.crypto.Cipher.getInstance(DashoA6275) at pdfDownload.jspService(_pdfDownload.java:215) [SRC:/pdfDownload.jsp:167] at com.orionserver[Oracle9iAS (9.0.3.0.0) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:721) at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306) at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767) at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:259) at com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(HttpRequestHandler.java:106) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803) at java.lang.Thread.run(Thread.java:484)
    Pls advise, is there any other setting that needs to be done ?
    Thanks & Regards
    Arun

    Hi,
    I got the solution for this. JCE 1.2.2 is supported on JDK 1.4.1 and JDK 1.4.2, but both of them have different unrestricted policy jars. I was able to solve the problem once I downloaded the unrestricted policy jars for JDK 1.4.2 (which is used by BEA 8.1 SP5) from the following URL : http://java.sun.com/j2se/1.4.2/download.html
    Regards,
    Prashant Kale.

  • Where can I download Java version 1.6.0_26-b03-384 for Mac OSX 10.6.8?

    Where can I download Java version 1.6.0_26-b03-384 for Mac OSX 10.6.8, please? I cannot find it anywhere on the internet and i need it because Firefox is complaing that the plug-in is inactive which is BS.
    Thanks.

    Snow Leopard:
    http://support.apple.com/kb/DL1360
    Note: Java 1.6 for Leopard is 64 bit only, but for Snow Leopard it is available for both 32 and 64 bit.
    http://www.roguish.com/blog/?p=266
    Since August 2012 updates for Java (and especially Java Runtime Environment, which is what you actually need) must now be downloaded direct from Oracle:
    http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1637588.h tml
    (which is for Java 7)
    Further information here:
    http://www.oracle.com/us/corporate/press/1735645
    and their FAQ’s:
    http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/mac-faq.html
    The recently discovered zero-day flaw in Java 7 is so serious that the U.S. Department of Homeland Security has warned users to disable or uninstall it, and Apple has disabled the Java 7 plugin on Macs through its OS X anti-malware system, in order to protect users from a potentially serious security issue.
    You should disable Java (if not already done) until either the US Department of Homeland Security, or Oracle, declare it safe and Apple restore the facility. Oracle have released an update said to fix the security flaw, available from here:
    http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.h tml
    Javascript should not be disabled (it has nothing to do with Java).
    However, if you need the Jave 6 JRE and plug-in, MadMAC0 has posted at
    https://discussions.apple.com/message/20107182?ac_cid=tw123456#20107182
    Apple has also posted (Oct 22/12) the approved solution for restoring the Java 6 plug-in:
    Java for OS X 2012-006: How to re-enable the Apple-provided Java SE 6 applet plug-in and Web Start functionality.

Maybe you are looking for