Trying to understand the new Console.readline()

I tried the following:
public class Forum
   public static void main(String[] args)
      System.out.println("Enter a line of text:") ;
      String input = System.console().readline() ;
      System.out.println("You entered " + input) ;
}but I get the following error:
C:\...\Forum.java:6: readline(boolean) in java.io.Console cannot be applied to ()I don?t see a readline(boolean) method in the Console class.
What am I missing?
Also, what does it mean ? ??cannot be applied to ()?
Thanx to one and all.

JoachimSauer wrote:
That's a confusing error message and I couldn't believe that you got that one, until I tried it.
It seems there's a (probably private) readline(boolean) method in Console, which results in that message.
The method you like to call is called "readLine" (not the capital L).Picky, picky, picky.
Thanx a lot.

Similar Messages

  • I am trying to understand the new Everything Plan

    I am receiving the same service for thre same price as before. So exactly what does this help me with? I now see that I am paying $70 more per month for actually less service than what I could get thru ATT. I switched to Verizon because of better reception, but even that has gotten worse in the past serveral months. I was okay with paying slightly more for better service, but this is ridiculous. They promote a new plan that they hope will make me feel good but offers me nothing. If I am going to pay this much more per month I think I should at least get more coverage and noticeably better service. I am getting neither. NOT happy.

        ShowMeState, we want you to be happy with our network. This is why we've implemented these new plans. We're giving you so much MORE with these plans.  http://vz.to/1lwOwRQ Let's look deeper into your coverage to ensure that you're getting the best service. What's your zip code? Which phone do you have? What service issues are you experiencing?
    LasinaH_VZW
    Follow us on Twitter @VZWSupport

  • HT4061 I have been trying to understand the new itunes, as I want to get into my music library, and getting very frustrated not being able to figure it out.  Can you help by walking me through it?

    Recently you changed the itunes and I am unable to download additional music from my computer to iphone.  How do I do this, as I want to update my music, etc.?

    Open iTunes, click on view, click on show side bar to get the classic style of iTunes.

  • [SOLVED] Trying to understand the "size on disk" concept

    Hi all,
    I was trying to understand the difference between "size" and "size on disk".
    A google search gave plenty of results and I thought I got a clear idea about
    it.. All data is stored in small chunks of a fixed size depending on the
    filesystem and the last chunk is going to have some wasted space which
    will *have* to be allocated.. Thus the extra space on disk.
    However I'm still confused.. When I look at my home folder, the size on disk
    is more than 320 GB, where as my partition is actually less than 80 GB, so
    I guess I'm missing something.. Could somebody explain to me what does
    320 GB of 'size on disk' means?
    Thanks a lot in advance..
    Last edited by geo909 (2011-12-15 23:17:25)

    Hi all,
    Thank you for your replies.. My file manager is indeed pcman fm and
    indeed it seems to be an issue.. In b4data's link the last post reads:
    B-Con wrote:
    FWIW, I found the problem. (This bug is still persistent in v0.9.9.)
    My (new) PCManFM bug report is here: http://sourceforge.net/tracker/index.ph … tid=801864
    I submitted a potential patch here: http://sourceforge.net/tracker/?func=de … tid=801866
    Bottom line is that the file's block size and block count data from the file's inode wasn't being interpreted and used properly. The bug is in PCManFM, not any dependent libraries. Details are in the bug report.
    Since PCManFM is highly used by the Arch community, I figured I should post an update here so that there's some record of it in our community. Hopefully this gets addressed by the developer(s) relatively soon. :-)
    I guess that pretty much explains things.. And I think I did understand the 'size on disk' concept
    anyway
    Thanks again!
    Last edited by geo909 (2011-12-15 23:17:10)

  • Trying to understand the code???

    Hi,
    I am trying to understand the following bit of code, currently the code puts each catalogue into a different row of the table but i want each catalogue to be put in the next column
    (so the catalogues appear across the page on the actual web page). The following code is for the page in question but im not sure how much is relevant so i will paste it all and highlight the section i think is relevant:
    <html>
    <%-- DECLARATIONS --%>
    <%@ page import="se.ibs.ns.cf.*,  se.ibs.ccf.*, se.ibs.bap.*, se.ibs.bap.util.*, se.ibs.bap.web.*,  java.util.*, se.ibs.ns.icat.*, se.ibs.bap.asw.cf.*, java.lang.*" %>
    <% ItemCatalogueBean bean = (ItemCatalogueBean)SessionHelper.getSessionObject("ItemCatalogueBean",session);
       String resourcePath = bean.getResourcePath(null);
       String title = "Product catalogue";
       String languageCode = bean.getLanguageCode();
    %>
    <%@ include file="FuncHead.jsp" %>
    <BODY class="IBSBody" onLoad="loaded = true;">
    <form method="POST" action=<%= bean.getEncodedServlet("se.ibs.ns.icat.ItemCatalogueSearchServlet", response) %> name="basicForm">
    <%@ include file="FuncSubmitScript.jsp" %>
    <%@ include file="FuncPageBegin.jsp" %>
    <div align="center">
      <table border="0" width="895">
        <tr>
          <td align="left" width="502">
    <div align="left">
      <table border="0" width="500">
        <tr>
          <td class="IBSPageTitleText" align="left" valign="top" width="238">
              <%@ include file="FuncPageTitle.jsp" %>
              <%@ include file="FuncPageTitleImage.jsp" %>
                    <br>
           On this page you can see the product catalogues. Click on one of the
           links to go to the next level. Alternatively you can click the <b>Search
           catalogue</b> button to find the products of interest.</td>
               <td width="248" valign="bottom">
                <div align="left"><%@ include file="FuncShoppingCart.jsp" %></div>
               </td>
        </tr>
      </table>
    </div></td></tr></table></div>
    <input type="submit" value="Search catalogue" name="ACTION_NONE" onClick="submitButtonOnce(this); return false">
    <hr>
    <%-- REPEAT CATALOGUES --%>
    <div align="left">
    <table border="0" width="100%">
    <% Vector catalogues = bean.getItemCatalogues();
            int cataloguesSize = catalogues.size();
               for (int i = 0; i < cataloguesSize; i++){
                      BAPItemCatalogue cat =  (BAPItemCatalogue) catalogues.elementAt(i); %>
              <%-- LINK AND MARK AS NEW --%>
                  <tr>
                         <td width="23%"><a class="IBSMenuLink" href="link" onClick="javascript:invokeLink('<%= bean.getEncodedServlet("se.ibs.ns.icat.ItemCatalogueCategoryServlet", response) %>?CODE=<%= ToolBox.encodeURLParameter(cat.getCode())%>'); return false">
                              <%= cat.getDescription(languageCode) %></a>
                         </td>
                         <td width="40%" align="right">
                              <% if (cat.isNew()) {%>
                                     <img border=0 src="<%= resourcePath %>new.gif">
                              <% } %>
                        </td>
                  </tr>
              <%--  CATALOGUES IMAGE AND INTERNET INFORMATION (text, multimedia objects,downloads, links...) --%>
                  <tr>
                         <td width="23%" valign="top" align="left">
                              <% if (bean.isAdvanced(cat) && bean.hasMultimediaImage(cat)) { %>
                                   <a href="link" onClick="javascript:invokeLink('<%= bean.getEncodedServlet("se.ibs.ns.icat.ItemCatalogueCategoryServlet", response) %>?CODE=<%= ToolBox.encodeURLParameter(cat.getCode())%>'); return false">
                                   <img border="0" src="<%= bean.getMultimediaImage(cat) %>"></a>
                        <% } else {%>     
                                   <img border="0" src="<%= resourcePath %>Catalog.gif">
                              <% } %>
                         </td>
                         <td class="IBSTextNormal" width="40%" valign="top">
                              <%= bean.getWebText(cat) %>
                         </td>
                  </tr>
                  <tr>
                         <td width="23%">
                         </td>
                         <td width="40%">
                         <% Vector mmLinks = bean.getMultimediaLinks(cat);
                      int mmLinksSize = mmLinks.size();     
                              for (int ml=0; ml<mmLinksSize; ml++){
                                   BAPCodeAndDescription mmLink = (BAPCodeAndDescription)mmLinks.elementAt(ml); %>
                                   <a class="IBSLink" href="<%= mmLink.getCode() %>" target="_blank"><%= mmLink.getDescription() %></a><br>
                         <% } %>
                   <% Vector webLinks = bean.getWebLinks(cat);
                        int webLinksSize = webLinks.size();
                        for (int wl=0; wl<webLinksSize; wl++){
                                   BAPCodeAndDescription webLink = (BAPCodeAndDescription)webLinks.elementAt(wl); %>
                                   <a class="IBSLink" href="<%= webLink.getCode() %>" target="_blank"><%= webLink.getDescription() %></a><br>
                        <% } %>
                         </td>
                  </tr>
                <%}%>
    </table>
    </div>
    <%@ include file="FuncPageLinks.jsp" %>
    <%@ include file="FuncPageEnd.jsp" %>
    </form>
    </body>
    </html>i hope someone could help me to understand this,
    thank you for your help

    You've probably already seen these, but here are a couple of links that may help.
    http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/operators.html#array_a ccess
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/Array.html
    What's basically happening is that the "for" loop goes through each item in the array.  Don't be confused by the fact that two of the items in the array are Strings and one is an Integer - variable i being a String has nothing to do with the data type of the elements in the array.
    The following code:
    private function createLabels():void
         var myArray:Array = ['one', 'two', 3];
         for(var i:String in myArray)
              trace("i = " + i);
              trace(myArray[i]);
    gives the following results:
    i = 0
    one
    i = 1
    two
    i = 2
    3
    From that we can see that the "for" loop is assigning the index number of each array element, not the actual array element ('one', 'two', or 3) to the variable i.  So calling myArray[i] is the same as calling myArray[0] the first time through the loop.  This type of "for" loop is just a shorter way of doing the following, which produces exactly the same results:
    private function createLabels():void
         var myArray:Array = ['one', 'two', 3];
         for(var i:int = 0; n < myArray.length; i++)
              trace("i = " + i);
              trace(myArray[i]);
    Hope that helps.
    Cheers!

  • Trying to understand the basic concept of object oriented programming.

    I am trying to understand the basic concept of object oriented programming.
    Object - a region of storage that define is defined by both state/behavior.
    ( An object is the actual thing that behavior affects.)
    State - Represented by a set of variables and the values they contain.
    (Is the location or movement or action that is the goal that the behavior is trying to accomplish.)
    Variables- (What does this mean?)
    Value - (What does this mean?)
    Behavior - Represented by a set of methods and the logic they implement.
    ( A set of methods that is built up to tell's the how object to change it's state. )
    Methods - A procedure that is executed when an object receives a message.
    ( A very basic comand.For example the method tells the object to move up, another method tells the method to go left. Thus making the object move up/left that combination is the behavior.)
    Class - A template from which the objects are created.
    ( I am very confused on what classes are.)
    - The definitions of the words I obtained from the "Osborne Teach Yourself Java". The () statements are how I interperate the Mechanisms (I do not know if Thats what you call them.) interact with each other. I understand my interpretation may be horribly wrong. I will incredibly appreciate all the support I may get from you.
    Thank you

    Object oriented programming is a replacement for the older idea of procedural programming (you can research procedural programming in google). As I understand it, in procedural programming, you have a step by step set of function calls to accomplish some task. Each function receives a data structure, manipulates it, and passes it to the next function. The problem with this is that each function preforms some action for the overall task and can't easily be reused by some other task. Its also harder to read the flow of what is happening with raw data structures flying all over the place.
    In object oriented programming, an object calls a function of another object and receives back, not a data structure, but another object. Objects contain a data structure that can only be accessed by its functions. An object is not so much a sub component of a bigger task, as it is a service that any other task can use for any purpose. Also, when you pass an object to the caller, the caller can ask questions about the data structure via its functions. The developer doesnt have to know what the previous function did to the data by reading up on any documentation, or having to reverse engineer the code.
    I suggest the best way of learning this is to code something like a library object.
    A library object contains a collection of book objects
    A book object contains a collection of chapter objects
    A chapter object contains a collection of paragraph objects
    A paragraph object contains a collection of sentence objects
    A sentence object contains a collection of word objects.
    Add functions to each object to provide a service
    Example: A library object should have a:
    public void addBook(Book book)
    public Book getBook(String title)
    public boolean isBookInLibrary(String title)
    The key is to add functions to provide a service to anyone who uses your object(s)
    For example, what functions (service) should a paragraph object provide?
    It shouldn't provide a function that tells how many words there are in a sentence. That function belongs to a sentence object.
    Lets say you want to add a new chapter to a book. The task is easy to read
    if you write your objects well:
    Sentence sentence1=new Sentence("It was a dark and stormy night");
    Sentence sentence2=new Sentence("Suddenly, a shot ran out");
    Paragraph paragraph=new Paragraph();
    paragraph.addSentence(sentence1);
    paragraph.addSentence(sentence2);
    Paragraphs paragraphs=new Paragraphs();
    paragraphs.addParagraph(paragraph);
    Library library= new Library();
    library.getBook("My Novel").addChapter("Chapter 1",paragraphs).
    Now, lets say you want to have a word count for the entire book.
    The book should ask each chapter how many words it contains.
    Each chapter should ask its paragraphs, each paragraph should ask
    its sentences. The total of words should ripple up and be tallied at each
    stage until it reaches the book. The book can then report the total.
    Only the sentence object actually counts words. The other objects just tallies the counts.
    Now, where would you assign a librarian? What object(s) and functions would you provide?
    If written well, the project is easily extensible.

  • I am trying to install the new itunes and I keep getting error messages regarding my Apple Mobile Device....help!

    I am trying to install the new iTunes and I keep geting the error message "Apple Mobile Device" failed to start.  Verify you have sufficient privileges to start system services".  HELP

    Hey schouten53,
    Thanks for the question. I understand you are experiencing issues with the latest iTunes update. Let’s troubleshoot the iTunes installation by completely removing and reinstalling iTunes and all related components (it is important to remove all components in the order listed).
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    Additional Information:
    How to restart the Apple Mobile Device Service (AMDS) on Windows
    http://support.apple.com/kb/TS1567
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Thanks,
    Matt M.

  • I have just just installed a new version of itunes. When i tried to run the new version it came up with the message "The file ituneslibrary.itl cannot be read because it was created by newer version of itunes. Can anybody advise?

    I have just just installed a new version of itunes. When i tried to run the new version it came up with the message "The file ituneslibrary.itl cannot be read because it was created by newer version of itunes.
    I installed the new version because itunes had not recognised my ipod nano 5G, and told me to reinstall. Itunes selected which version to install, so I don't understand what is going on. To add insult to injury it installed a pile of malware which I am still trying to get rid off.
    Any advice would be helpful

    Hello Davedamoclese,
    Go through the below link to Remove iTunes and all its components from your computer first and then Re-install fresh copy of iTunes on your computer.
    http://support.apple.com/kb/HT1923
    Note : DO not delete iTunes Library as it contains all your iTunes data, please go through the below link for where it is saved on your computer :
    http://support.apple.com/kb/ht1391
    You can download the latest version of iTunes from the below link :
    http://www.apple.com/itunes/download/

  • I'm trying to download the new OS X Lion

    I'm trying to download the new OS X Lion from the app store, however when I click Purchase, nothing happens. It simply shows the price '20.99' again.

    Thank you for your response.
    Processor 3.06 Ghz Intel Core 2 Duo with 4GB Ram.
    I understand it might take a while to download, but it doesn't even start. I click on "£20.99" and it then says "Buy App" when I click that one, it doesn't do anything except change back to the price. No installation box or anything.

  • I am trying to use the new iwork beta tools on iCloud.  I currently have 10.8.4 OSX on my iMac and 6.0.5 version of Safari, but when I try to open documents on my iphone in the cloud it tells me my browser isn't supported

    I am trying to use the new iwork beta tools on iCloud.  I currently have 10.8.4 OSX on my iMac and 6.0.5 version of Safari, but when I try to open documents on my iphone in the cloud it tells me my browser isn't supported

    Note that iWork for iCloud is only designed for PCs and Macs > http://support.apple.com/kb/HT5779
    To access to your iWork documents on the iPhone, install Keynote, Numbers or Pages from the App Store

  • I am trying to determine the new project preset for multi-camera video shot as follows:  3 Canon camcorders, main shot is DV (tape) (720x480), b-roll is DVD (mini-disk) (720x480), additional b-roll is AVCHD (1920x1080).  Film is from a wedding, DV contain

    I am trying to determine the new project preset for a multi-camera video shot as follows:  3 Canon camcorders,
    Main shot is DV (tape) (720x480, 29fps) - ceremony and reception
    b-roll is DVD (mini-disk) (720x480, 29fps) - bride preparations
    additional b-roll is AVCHD (1920x1080, 29fps) - groom preparations and misc all day ceremony and reception. 
    Film is from a wedding, DV contains main footage so I assume it will need to be the base.  I am planning to use the preset for DV-Widescreen.  Is there a better option?  I'm concerned about playback as the three appear to have different PAR.  I'm using Premiere Elements 10 on W8.
    Ultimately this will be burned for two formats - one for a DVD that can be watched on a widescreen TV, second for a short clip trailer to go on vimeo.
    (And no I won't be doing this again for a wedding that I shoot.)

    VDRAVES
    Please review since I am not sure how you obtained Video 3 tall when you scaled Video 3 with Constrain Proportions in effect.
    Before
    After
    It becomes a zoomed in effect to get rid of the black borders. But, there is no tall and thin involved anywhere.
    And, after the Scale increase, you can always click on the screen and move the image around a bit
    (without overdoing it to get black borders again).
    After and an adjust
    Please let us know if you are OK with the information above.
    Thank you.
    ATR

  • I tried to install the new iOs 7 on my iphone 4, but it wasn't completed (showing error 4005). Now, my iphone is stuck on the itunes' logo with the usb cord, and I can't use my phone. And itunes doesn't detect my iphone when I connect it on my computer.

    Hi everyone! I tried to install the new iOs 7 on my iphone 4, but it wasn't completed (showing error 4005). Now, my iphone is stuck on the itunes' logo with the usb cord, and I can't use my phone. And itunes doesn't detect my iphone when I connect it on my computer, so I can't put it in recovery mode or someting like that... What can I do?? I tried everything they tell me to do in the apple support but nothing seems to work. Thank you!

    No problem, glad to help!
    Update: my PC USB hub was connected to a USB 3 port, I connected the 30 pin cable directly to my PC, And the restore worked just fine. Restored phone from iCloud backup and seems to be working fine.

  • I am trying to update the new OS however, I keep getting an error messaging saying to have my connectivity checked since it is not connected. I ran a diagnostics test and everything passed. Any ideas on how I can to make sure a connection is established?

    I am trying to update the new OS system on my iPhone 4, however, when I connect to iTunes and try to download, I keep getting an error message that says the connection is not established. I ran a diagnostics test and everything passed, however, I'm not sure why I keep getting an error message when the software is at the end of downloading.
    Any tips?

    Disable your firewall/security software.

  • TS3212 Help I have tried to download the new Itunes but it keeps popping up service apple mobile device failed to start verify you have sufficent privledges  to start then my computer froze altogether and I had to end task which then deleted my existing I

    Hepl I tried to download the new version of Itunes  but it came up with the message service apple mobile failed to start verify you have sufficient privledges to start then my computer froze altogether and I had to end task , which wiped my existing itunes and same message keeps popping up when I try to install how do I get my itunes reset up and do I lose all my music ?

    Hello, dindillon. 
    Thank you for visiting Apple Support Communities.
    Here are the best steps to help you resolve this issue.  This will not modify your media library. 
    How to restart the Apple Mobile Device Service (AMDS) on Windows
    http://support.apple.com/kb/TS1567
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Cheers,
    Jason H.

  • When I tried to download the new version of firefox I get an error message that says "you computer must be restarted to complete an earlier upgrade" when I restart it says the same thing. I cannot use firefox at all at the moment.

    When I tried to download the new version of firefox I get an error message that says "your computer must be restarted to complete an earlier upgrade" when I restart it says the same thing. I cannot use firefox at all at the moment. When I try to uninstall in the control panel, the same message pops up.

    If you have problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the DMG file to the desktop
    * Firefox 5.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so you won't lose your bookmarks and other personal data.

Maybe you are looking for

  • Crystal Repts XI - Adding labels to summary fields in crosstab report

    I have a crosstab report where Columns first-level are priority or non-priority schools second-level are priority type Rows First-level: month second-level: count of calls opened this month; sum of time spent; opened prior to reportstart and still op

  • DB lookup in XI

    Hi , Can we do DB look up in XI? Any body has any exmaple codes?. If you could provide , i would appreciate it. Regds, Ram.

  • Error in mru internal routine: ORA-20001: Error in MRU: row= 1

    Hi I have a Multi-Row Report, where you can change the status in on column Example: 7939 Jones (Manager/Clerk/President) .... 8000 SCOTT (Manager/Clerk/President) I used a select list for the 3rd column. If i Try to Update this report i get: Error in

  • How to create consumption report

    hi all thanks in advance i want to create consumption report in mm can u send logic and code which easy and fast for me please thanks

  • DZ Document Showing Future Baseline Date

    We have a DZ document that is showing a future baseline date. The billing document was created 12/14/09 and payment document was generated 12/28/09. The payment terms in OBB8 is net due 55days. However the baseline date in the clearing document is sh