Doubt about constructor and show.Input dialog

Hi everybody!
I wrote this program in java. It works, but I have some doubts. The points that are not clear to me are in comments. Thanks in advance:
import javax.swing.JOptionPane;
public class Bicicleta extends JOptionPane{
     int velocidad;
     int cambios;
     String color;
public Bicicleta(){// Why we have to make a constructor without procedures, if we have the constructor public Bicicleta(values) down?
                         //I mean, if we delete this constructor,
                         // the program will not work.
public Bicicleta(int cambiarVelocidad, int cambiarCambios, String cambiarColor){ //without the constructor bicicleta
     velocidad = cambiarVelocidad;                                                            // that is up of this procedure,     
     cambios = cambiarCambios;                                                                 // the program will not work, Why?
     color = cambiarColor;
public int getVelocidad(){
     return velocidad;
public int getCambios(){
     return cambios;
public String getColor(){
     return color;
public void setVelocidad(int nuevaVelocidad){
     velocidad = nuevaVelocidad;
public void setCambios(int nuevoCambio){
     cambios = nuevoCambio;
public void setColor(String nuevoColor){
     color = nuevoColor;
public void showBici(){
     this.showMessageDialog(null, "Los valores de la nueva bicicleta son: Velocidad de "+velocidad+" tiene "
     cambios" cambios y es de color "+color);
public Bicicleta getBici(){
     return (new Bicicleta(this.getVelocidad(),this.getCambios(),this.getColor()));
public void setBicicleta(){
     velocidad = Integer.parseInt(this.showInputDialog("Inserte la velocidad de la bicicleta"));
     cambios = Integer.parseInt(this.showInputDialog("Inserte la cantidad de cambios de la bicicleta"));
     color = (this.showInputDialog ("Inserte el color de la bicicleta"));
public static void main(String[] args){
     Bicicleta bike = new Bicicleta();
     bike.setBicicleta();
     Bicicleta nuevaBici; // I copy this segment of code form anyone else, but I dont understand it.
     nuevaBici = bike.getBici();          // Can someone explain it please?
     nuevaBici.showBici(); //
}

The program is supposed to recollect the data with:
public void setBicicleta(){
velocidad =
= Integer.parseInt(this.showInputDialog("Inserte la
velocidad de la bicicleta"));
cambios =
= Integer.parseInt(this.showInputDialog("Inserte la
cantidad de cambios de la bicicleta"));
color = (this.showInputDialog ("Inserte el color de
e la bicicleta"));
So, I think that the values of variables are defined
by the user. So, we dont have to define any previous
data, because it is a input of the program user.
Maybe I?m wrong, so what is my error in this case?Not thinking about responsibilities? So when I go and create a new Bicycle, I have a bicycle with no color and no top speed. Have you ewver seen a bicycle like that? A bycicle that asks you about what color it should have? Shouldn't rather the one creating the bicycle be the one to ask you for the values, and then apply them to the bicycle he creates?
Do the asking first, then call
bike = new Bicicleta(theColor, theSpeed, theGears, whatever);That way you can also get rid of that c'tor you don't want, since it makes no sense anyway.

Similar Messages

  • Doubt about Scan and Update Catalog Objects That Require Updates link

    Hi,
    I have a doubt about 'Scan and Update Catalog Objects That Require Updates' link in Administration,
    how can I know how many objects that required upgrading before I click this link???
    in doc.
    http://docs.oracle.com/cd/E28280_01/bi.1111/e10541/prescatadmin.htm#BIESG3750
    section 17.2.4 Updating Catalog Objects
    It is said 'You can confirm the need to update by viewing the metrics in Fusion Middleware Control. In the Catalog folder, find a metric called "Reads Needing Upgrade" with description "The number of objects read that required upgrading." '
    but I don't find it . my OBIEE version :11.1.1.6.2
    conld you pleae help me ??
    thank you in advance.

    That link should be there in 6 version.
    I've verified in 11g6 version doc the same is existing
    ref: http://docs.oracle.com/cd/E23943_01/bi.1111/e10541/prescatadmin.htm#BAJDDFFI
    BTW:
    http://docs.oracle.com/cd/E28280_01/bi.1111/e10541/prescatadmin.htm#BIESG3750is 11g7 version
    Thanks,
    http://cool-bi.com

  • Doubt about Role and Policy

    Hi everyone,
    I have a doubt about role and policy,
    I'm using OBIEE11.1.1.5, I try to creating role R1 by creating like BIConsumer.
    then I go to policies interface,Edit 'BIConsumer' policy,
    I find only one role 'BIConsumer' under grantee.
    so I'd like to ask why 'R1' is not under policy 'BIConsumer' while R1 has permission like role BIConsumer ???
    thanks in advance!

    Application policies are sets of java permissions that are associated with a principal which is BIConsumer role in this case which grants permissions necessary to use, or to consume, content created by other users.
    So when you try to create like BIConsumer, you are not modifying the existing BIConsumer principal policy( which you should never do) but instead trying to create one similar grants like it.
    Usually as long as you are not dealing with BI Publisher, Financial Reporting and Real-Time Decisions application security permissions restriction, you would not have to modify any of these policies and use the default ones.
    Hope this helps. Pls mark if it does.
    Thanks,
    SVS

  • Doubts about installation and features

    I'm a newbie on WebCenter Portal Framework and I have to build a PoC with some features like CMS, online collab, chat, analytics, single sign on, search engine and two sites.However, I don't know what should be installed in order to provide all these features.
    Is there a integrated product suite or should I install WebCenter Content, WebCenter Portal, WebCenter Sites and WebCenter social separately ?
    Thanks a lot.

    Hi.
    For your PoC first you need to know what you want exactly, web site? intranter portal?, collaboration?.
    If you want websites probably your solution is only WebCenter Sites.
    If you want "two sites" in a collaboration intranet your solution is WebCenter Portal : Spaces.
    In the case of WebCenter Portal : Spaces you need to install WebCenter Suite (includes WebCenter Content, Portal, Discussions, Activities, Portlets...).
    A PoC of your functionallity could be achieved by:
    - Use WebCenter Portal : Spaces and create two spaces to simulate your two sites.
    - CMS: Install and configure WebCenter Content for your WebCenter Portal : Spaces solution. Create one or two type of contents and create Content Presenter Templates to show them.
    - Collaboration: With WebCenter Portal Suite includes Collaboration Server based on Jive forums. Configure it for use it with WebCenter Portal : Spaces.
    - Chat: Read official documentation for how to integrate different chat providers to WebCenter Portal : Spaces.
    - Analytics; With WebCenter Portal Installation includes Activities Service. Configure the collector for WebCenter Portal : Spaces and show metrics with OOTB Task Flows.
    - SSO: Install Oracle OAM for SSO. Configure WebCenter Portal : Spaces for OAM SSO. You'll need webserver too (OHS or Apache).
    - Search: For a default search you can use WebCenter Default Search Adapter. If you need a powerfull search engine install Oracle SES (Secure Enterprise Search).
    I hope this help you.
    Regards.

  • Doubt about infos of show interface

    Hi, folks!
    Someone could explain or send me a link of Cisco paper which explain the informations get by show interfaces?
    I would like to know about:
    runts, giants, throttles,frame, overrun, ignored, watchdog, multicast,
    input packets with dribble condition detected, underruns, interface resets,
    babbles, late collision, deferred, output buffer failures,
    output buffers swapped out?
    What does that things means?
    Some fasteth in our switches has "ignored", but ignored what?
    thanks,
    Renato

    Hi Renato,
    Here you go. This link will explain you each and everything.
    http://www.cisco.com/en/US/products/hw/switches/ps700/products_tech_note09186a00800a7af0.shtml
    regards,
    -amit singh

  • I have rented and watched 4 movies which, though expired still appear in my video folder.  I cannot watch them, but my ipad shows 4 videos in the "about" tab and shows several gigs of video used.  How do I get rid of them and free up the memory?

    I need to find a way to delete itunes rented movies that still seem to remain on my ipad after being watched.  The ipad shows memory allocated to the video and counts them in the "about" tab of my settings.  I can't watch them and cannot seem to delete them from the ipad or during sync.

    Go in Settings. Video. Un click the Show all videos

  • Doubt about Sync and Async process

    hi experts i have one small doubt
    if we r having the scenario like file to rfc
    iam passing the input parameter like material number through file  adapter
    and then i want to get the material details response from rfc sap r/3 to file system
    this is the scenario.
    now here which is the synchronous processs 
    and which is the asynchronous process
    please let me know
    clear my doubt with explanation please......
    thanks
    giri

    Hi Sesha,
    For information on sync/async please refer:
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/43/65d4dab39b0398e10000000a1553f6/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/43/65d4dab39b0398e10000000a1553f6/frameset.htm</a>
    <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/83/d2a84028c9e469e10000000a1550b0/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/83/d2a84028c9e469e10000000a1550b0/frameset.htm</a>
    Regards,
    Subhasha ranjan
    Message was edited by:
            Subhasha Ranjan

  • Doubts about XI and RFC or IDOC

    Hello
    We have an external system that will send a file with data, with data from that file will have to make some Batch input on a number of transactions and I doubt arises in the orient
    The platform of exchange will be XI and I would like if someone could guide me in which are the advantages and disadvantages of undertaking such Batch Inputs through IDOC or through an RFC function or if there is another better way to make this process
    Thanks

    Hi Alberto.
    As far as I understand your scenario, you are fetching the data from a file and update the R3 database using a BDC session.
    In that case, my suggestion is to use a custom RFC that takes these records and creates a BDC session. This would be a better way to handle this scenario instead of using any IDOCs.
    Regards,
    Hari.

  • General doubt about devices and java applets

    I have one general doubt abt devices.
    Do all devices come with an SDK so that any language can interact with them?.
    Whats does it mean if i say that i need to build a CAB file for the devices
    and use them in my html object tag.
    Can programming languages like java(applets) or asp interact with devices
    once if we specify the classid and the cab file location(codebase)

    Let me make it more clear
    What i need is if we r using an ActiveX Component then we pack the .ocx and inf file into a cab file and give the location of the CAb file in the codebase attribute of object tag.
    When the browser renders the page, it will look into the classid attribute of object tag to see whether there is an entry in registry if not it will go to the location specified in the codebase and get it registered locally.
    As you know ActiveX works on windows.
    I want to implement the same thing in a platform independent way.
    So i chose java applets.
    Now i don't know what to do in this codebase part.
    i need to install the device driver files and all from the server once a person view the web page.
    when we use activex the classid field represents the device's entry but when we use applets thats the version of java being installed.
    Can any one suggest an idea to move.

  • Doubts about InDesign and DPS

    One thing I do not understand about InDesign CS5.5 and Digital Publishing Suite.
    Do you have to buy Digital Publishing Suite, or is included when you purchase Creative Suite 5.5?

    OK, thank you.
    But I can't make the file without being connected to internet, isn't it?

  • Doubt about OMS and Security

    Hi all.
    Production:
    [oracle@sdat0201lx bin]$ ./emctl status agent -secure
    Oracle Enterprise Manager 10g Release 4 Grid Control 10.2.0.4.0.
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    Checking the security status of the Agent at location set in /u01/app/oracle/product/10.2.0/agent10g/agent10g/sdat0201lx/sysman/config/emd.properties... Done.
    Agent is secure at HTTPS Port 3872.
    Checking the security status of the OMS at http://sdat4101lx:4889/em/upload/... Done.
    OMS is running but has not been secured. No HTTPS Port available.
    Testing:
    [oracle@sdat2202lx bin]$ ./emctl status agent -secure
    Oracle Enterprise Manager 10g Release 4 Grid Control 10.2.0.4.0.
    Copyright (c) 1996, 2007 Oracle Corporation. All rights reserved.
    Checking the security status of the Agent at location set in /u01/app/oracle/product/10.2.0/agent10g/sdat2202lx/sysman/config/emd.properties... Done.
    Agent is secure at HTTPS Port 3872.
    Checking the security status of the OMS at http://sdat4101lx:4889/em/upload/... Done.
    OMS is secure on HTTPS Port 1159
    My doubt is: OMS is the same, right? Why for Production is unsecured and for Testing is secured??
    What i do in Production?
    secure OMS or unsecure the Agent?
    Thanks all...!!

    Your production server cannot access port 1159 on your oms.
    probably a firewall configuration issue

  • Doubt About Integration And Certification

    Hi Expers,
    I have One Doubt. What is SAP Integration And Certification????
    Why  People wil  Do this At SAP Integration And Certification Center??
    Is there Any Benifit By Doing This one?????
    Please Clear my All Doubts.....
    Regards
    Khanna

    Hi
    Services offered though integration and certificaiton are
    Access to SAP test systems
    Integration assessment
    Integration consulting and workshops
    Integration certification
    SAP ICC premium services --
    Through regional SAP Integration and Certification Centers (SAP ICCs), SAP offers integration and certification services, such as an interface certification program, consulting, and access to test systems
    Go throught these links
    http://www.sap.com/partners/icc/index.epx

  • EXCEPTION_DURING_EXECUTE- Error in Mapping. Doubt about IE and AE

    Hi every one,
    I got an error related to mapping,in one of my scenarios, as <b>EXCEPTION_DURING_EXECUTE</b>
    As per my knowledge,
    <b>IE lies on ABAP stack. AE lies on Java Stack.</b>
    Mapping is done in Java stack.(we r using inbuilt Mapping tool of XI). <b>And so all the mapping errors should be in AE only, right?</b>.
    <u>But y this error is displayed in IE.(sxmb_moni)?</u>
    Please explain.
    Thanks,
    -Naveen.

    Hi,
    <i>And so all the mapping errors should be in AE only, right?.</i>
    No, only adapter related errors will be in the AE. Because message is part of Integration engine Pipeline.
    AE/Adapter Engine comes to picture when Collaboration agreement is happening. After that message will be in the Integration Engine.
    Hope this helps,
    Regards,
    Moorthy

  • Little doubt about xml and jspx, someone would give me a explaiation please

    Hi!!
    What's the diference between a .jspx and .xml file? do they have the same porpose? can I replace a .jspx for .xml file ?
    Thanks!!!

    If you can't get AOL to talk you thru it, then it's time to stop using AOL.
    You are paying extra for a useless service. You already pay (and HAVE TO PAY) to the internet company that gives you the internet modem and conneciton to the internet, and they are be giving you 1-5 free email addresses with that account. (call them if you never set them up).
    There is no guarantee you don't have a problem with your mail setup on your computer, but this is the right time for you to set up your [email protected] accounts, download all your AOL mail including your address book (FROM AOL'S WEBISTE via Safari) to your hard drive, make sure you are using an external drive with Time Machine and doing daily if not hourly backups, and start sending emails to your friends and family and business from the new mail account(s).
    Otherwise you can call someone who saves computers and AOL accounts for a living and pay them $25- $100 hour....

  • Doubt about VA02 and exit MV45AFZZ.

    Hi Gurus.
    I´m working in exit MV45AFZZ.
    Tha functional has a process in va02 where he changes the field 'cause of the decline' and when he does it then occurs a message error
    because it pass by exit in perform of validation.
    The functional needs that i change the logic  when he does that process then don´t pass by that perform of validation.
    the process finish when click in button save BUT MANY OTHER PROCESS TOO.
    HOW CAN I DO FOR  don´t pass by that perform of validation WHEN HE DOES THAT ESPECIFIC PROCESS?
    THANKS FOR HELP.

    Thanks for response Mr. max bianchi.
    I need know WHAT is the difference in that process then i can use that difference like a filter in my code.(a strucute , field valoe , or etc...)
    But i think that information only the function can help me in this case .Because he knows the process.
    Do you agree.?

Maybe you are looking for

  • I can't load Snow Leopard on an empty partition

    In February I bought a new Mac Book Pro that came loaded with OS X Lion.  I want to run Final Cut Pro on it.  I bought FCP on ebay but can't load it because it is a PowerPC app and Lion won't load it.  I added a partition to my hard drive to load Sno

  • Close main application window in WD for Java

    Hi there, Is there anyway I can close the main application window(not popup) programatically. I tried calling the exit plug in the interface view controller, but doesnt seem to close the window automatically. I am having 2 components, one calling the

  • Grant permission on SCOTT/tiger schema

    grant select, insert, update, delete on EM to BOMBAC I want to add permission that user BOMBAC can see EM table from SCOTT/tiger scheme and use it. But he can not see and use it. Any idea why? regards

  • LAN Gaming: Delta Force BHD...can't see pc or vise versa hosted game

    Sorry, didnt know where else to go but here. I've checked on Google, and can't find anything about this. I'm on a home network, windows and apples firewall is off, newest well only version of the Mac game 10.5 and the newest ver for pc 1.5 but can't

  • Weblogic Starting Problem

    Hi All,    I have installed Weblogic 10.3.5 on Oracle Linux Server release 6.5 x86_64 . When I start my server from the script i.e. ./startWeblogic.sh I get this error : <Dec 23, 2013 12:13:05 AM EST> <Notice> <WebLogicServer> <BEA-000365> <Server st