Newbie with Hand class problem !!

Hi all, I,m new to Java and programming in general. I need to create a Hand class from a Card class that I wrote. The Card class uses a toString to return the string representation of the card and suit. I need a default constructor which is empty so is no problem for me nor is it a big problem to create a constructor that creates an array of cards. My problem is creating a method to add a single card and subtract a single card. Also testing that no two cards are the same. I understand most of this stuff when I am in class but when I get home I don't seem to know how to proceed. Any help is greatly appreciated. Thanks!!!!
PS: I mistakenly posted this on the new to Java Technology thread. Sorry for the double post!

The cross-post is at http://forum.java.sun.com/thread.jsp?thread=411785&forum=54&message=1811450

Similar Messages

  • Accessing MS Sql Server with Java classes - problem connecting to socket

    I found an example at this location which uses java classes to connected to MS Sql Server.
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    --bummer - it is a login location - so I will include the article
    Anyway, the example is using Websphere, but I am still on Jbuilder (will get wsad soon). So I planted the classes from the example in
    C:\Borland\JBuilder\jkd1.4\jre\lib\ext\...the classes
    Then I copied the code from the example to my jpx project and got an error that it could not connect to the socket. The only thing I changed in the code was the connection string:
    --original string from example:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    I was getting an error with the 2 argument version of DriverManager - and the second argument here was empty (properties argument). Here was my connection string:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    I am only using the 1 argument version of DriverManager. Note that the password=" is blank because my RnD workstation is standalone - no one accesses the sql server except me - so no password. I also left out the last semicolon I noticed. Any suggestions appreciated how I could fix this.
    Thanks
    source of article:
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    iSeries 400 Tips:
    TIPS & NEWSLETTERS TOPICS SUBMIT A TIP HALL OF FAME
    Search for: in All Tips All search400 Full TargetSearch with Google
    PROGRAMMER
    Sample code: Accessing MS SQL Server database from the iSeries
    Eitan Rosenberg
    09 Mar 2005
    Rating: --- (out of 5)
    Nowadays with the help of Java the iSeries can be integrated with other databases quite easy. This tip shows you how. The code included here uses the free Microsoft driver that can be downloaded from here. (SQL Server 2000 Driver for JDBC Service Pack 3)
    If your SQL server does not include the Northwind Sample Database you can find it here.
    http://www.microsoft.com/downloads/details.aspx?familyid=07287b11-0502-461a-b138-2aa54bfdc03a&displaylang=en
    The download contains the following files:
    msbase.jar
    mssqlserver.jar
    msutil.jar
    Those files needs to be copied to the iSeries directories (/home/r_eitan/ExternalJARs).
    Here's the directory structure (on the iSeries) for this sample:
    /home/r_eitan/ExternalJARs - Microsoft files (msbase.jar,mssqlserver.jar,msutil.jar)
    /home/r_eitan/JdbcTest02 - My code (Main.java,Main.class)
    The Java code
    import java.sql.*;
    import java.io.*;
    class Main {
    * Connect to Microsoft SQL server and download file northWind.products as tab
    * seperated file. (products.txt)
    public static void main(String args[]) {
    try {
    PrintStream outPut = new PrintStream(new BufferedOutputStream(new FileOutputStream("products.txt")));
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    //Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    System.out.println("Connection Done");
    connection.setCatalog("northWind");
    String sqlCmdString = "select * from products";
    Statement statement = connection.createStatement();
    ResultSet resultSet = statement.executeQuery(sqlCmdString);
    ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
    int columnCount = resultSetMetaData.getColumnCount();
    // Iterate throught the rows in resultSet and
    // output the columns for each row.
    while (resultSet.next()) {
    for (int index = 1; index <=columnCount; ++index)
    String value;
    switch(resultSetMetaData.getColumnType(index))
    case 2 :
    case 3 :
    value = resultSet.getString(index);
    break;
    default :
    value = """ + resultSet.getString(index) + """;
    break;
    outPut.print(value + (index < columnCount ? "t" : ""));
    outPut.println();
    outPut.close();
    resultSet.close();
    connection.close();
    System.out.println("Done");
    catch (SQLException exception)
    exception.printStackTrace();
    catch (Exception exception)
    exception.printStackTrace();
    --------------------------------------------------------------------------------------------------

    My guess is that the server's host name isn't right. It necessarily (or even usually) the "windows name" of the computer. Try with the numeric IP address instead (type "ipconfig" to see it).
    First aid check list for "connection refused":
    - Check host name in connect string.
    - Check port number in connect string.
    - Try numeric IP address of server host in connect string, in case name server is hosed.
    - Are there any firewalls between client and server blocking the port.
    - Check that the db server is running.
    - Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port.
    - Try "telnet serverhost the-port-number" from the client, to see if firewalls are blocking it.
    - If "telnet" fails: try it with the numeric ip address.
    - If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
    - Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

  • Mac newbie with a "stacks" problem

    Now, you're dealing with a former Windows person here making the transition...
    In setting up my desktop, my stacks don't work. when I minimize applications windows, they just line up on that bar...had stacks initially but not now.
    How do I get this cool function back?
    I do Ind out what version of MAC OS I have?
    would appreciate help with this first (of potentially many) questions as I cross over to the Mac world.
    thanks

    How do I get this cool function back?
    Drag a folder to the Dock...don't minimize them.
    I do Ind out what version of MAC OS I have
    Apple menu --> About this mac

  • Newbie with an Urgent problem- BlueJ and Compiler related

    Hi, ok so I've downloaded the latest version of BlueJ (2.1.2) and have all of the Java components (i.e. BlueJ actually starts). However when I try to compile a program all it says is "Compiling..." in the corner. Nothing happens and when I click inside the window the message disappears with nothing being changed. Am I missing something glaringly obvious? This is my first encounter with BlueJ and the whole Java-thing. Also, time is a factor so a quick response would be INCREDIBLY appreciated. Thanks in advance.

    Hi, ok so I've downloaded the latest version of BlueJ
    (2.1.2) and have all of the Java components (i.e.
    BlueJ actually starts). However when I try to compile
    a program all it says is "Compiling..." in the
    corner. Nothing happens and when I click inside the
    window the message disappears with nothing being
    changed. Am I missing something glaringly obvious?
    This is my first encounter with BlueJ and the whole
    Java-thing. Also, time is a factor so a quick
    response would be INCREDIBLY appreciated. Thanks in
    advance.Hi,
    Well I dont Know much about the BlueJ IDE but I definately advise you to use the JCreator IDE that is perfect for a beginner and has easy to use interface. You can download the Lite Version (which is absolutely free) from:
    http://www.jcreator.com
    I had tried BlueJ but didn't like it.
    Good Wishes,
    Amanullah

  • From sort of newbie with a video problem

    Hello all... am attempting to launch a video clip
    (.mov file..) in a new window by linking from an image. Click on
    the image, it SHOULD open video clip in new window/page. It works
    from the local site (on my pc) but not from remore server.... I'd
    appreciate any help... please repsond to [email protected] as I will
    be checking email remotely....thanks a googolplex.....
    doctorpixel

    Hi Lexstan.  I highly suggest you take your phone back where you purchased it.  Your phone is definitely posessed!  Just kidding!
    What you explained in item #1 is very strange!  Have it checked out!

  • Newbie with Sockets. Speed problem

    Hi. I am newbie with Sockets. I have read java socket tutorials and wrote these two classes. The client tries to transfer file of 13MB to the server. This is done in internal network. Client and Server use 100Mb network cards. The problem I have is speed of transfer. It takes 4-5 sec to transfer this file.
    13MB * 8 / 5sec = 20Mb/s
    It seems slow to me considering that network cards are 100Mbit. I would expect to get at least 50-70Mb/s. It is my home network and noone else is using it.
    So, what I am doing wrong?
    public class Client {
    public Client() {
    public static void main(String[] args) {
    try {
    FileInputStream in1 = new FileInputStream("c:\\Documents and Settings\\Pavel\\jbproject\\untitled1\\src\\tryw\\test.txt");
    InetAddress addr = InetAddress.getByName("server");
    Socket s = new Socket(addr, 5000);
    OutputStream out = s.getOutputStream();
    BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
    System.out.println((new Date(System.currentTimeMillis())).toString());
    byte[] buffer1 = new byte[1024];
    int g;
    while ((g=in1.read(buffer1))!=-1 ) {
    out.write(buffer1);
    System.out.println((new Date(System.currentTimeMillis())).toString());
    s.close();
    System.out.println((new Date(System.currentTimeMillis())).toString());
    }catch(Exception e){System.out.println(e.getMessage()); }}}
    public class Server {
    public Server() {
    public static void main(String[] args) {
    ServerSocket s = null;
    try {
    s = new ServerSocket(5000);
    while (true) {
    StringBuffer buffer = new StringBuffer();
    // Wait for a connection request from a client
    System.out.println("Waiting");
    Socket clientConn = s.accept();
    InputStream in = clientConn.getInputStream();
    OutputStream out = clientConn.getOutputStream();
    PrintWriter outp = new PrintWriter(out, true);
    BufferedReader inp = new BufferedReader(new InputStreamReader(in));
    String inputLine = null;
    Date date = new Date(System.currentTimeMillis());
    System.out.print(date.toString());
    while ((inputLine = inp.readLine()) != null) {
    buffer.append(inputLine);
    if (inputLine.equals("Bye."))
    break;
    Date date1 = new Date(System.currentTimeMillis());
    System.out.println(date1.toString());
    System.out.println(buffer.length());
    }catch(Exception e){System.out.println(e.toString());try {s.close();}catch(Exception he) {}}}}

    you probably want the buffering to occur under the PrintWriter, not the other way around, ie the buffering should be closest to the raw socket.
    You can bump up the size of the Buffering in the ctor, that might help.
    You can also gulp bigger blocks on the read.

  • Getting problem with DOMImplementation classes method getFeature() method

    hi
    getting problem with DOMImplementation classes method getFeature() method
    Error is cannot find symbol getFeature()
    code snippet is like...
    private void saveXml(Document document, String path) throws IOException {
    DOMImplementation implementation = document.getImplementation();
    DOMImplementationLS implementationLS = (DOMImplementationLS) (implementation.getFeature("LS", "3.0"));
    LSSerializer serializer = implementationLS.createLSSerializer();
    LSOutput output = implementationLS.createLSOutput();
    FileOutputStream stream = new FileOutputStream(path);
    output.setByteStream(stream);
    serializer.write(document, output);
    stream.close();
    problem with getFeature() method

    You are probably using an implementation of DOM which does not implement DOM level-3.

  • Problems with inner classes in JasminXT

    I hava problems with inner classes in JasminXT.
    I wrote:
    ;This is outer class
    .source Outer.j
    .class Outer
    .super SomeSuperClass
    .method public createrInnerClass()V
         .limit stack 10
         .limit locals 10
         ;create a Inner object
         new Outer$Inner
         dup
         invokenonvirtual Outer$Inner/<init>(LOuter;)V
         ;test function must print a Outer class name
         invokevirtual Outer$Inner/testFunction ()V
    .end method
    ;This is inner class
    .source Outer$Inner.j
    .class Outer$Inner
    .super java/lang/Object
    .field final this$0 LOuter;
    ;contructor
    .method pubilc <init>(LOuter;)V
         .limit stack 10
         .limit locals 10
         aload_0
         invokenonvirtual Object/<init>()V
         aload_0
         aload_1
         putfield Inner$Outer/this$0 LOuter;
         return
    .end method
    ;test
    .method public testFunction ()V
         .limit stack 10
         .limit locals 10
         ;get out object
         getstatic java/io/PrintStream/out  java/io/PrintStream;
         aload_0
         invokevirtual java/lang/Object/getClass()java/lang/Class;
         ;now in stack Outer$Inner class
         invokevirtual java/Class/getDeclaringClass()java/lang/Class;
         ;but now in stack null
         invokevirtual java/io/PrintStream/print (Ljava/lang/Object;)V
    .end methodI used dejasmin. Code was equal.
    What I have to do? Why getDeclatingClass () returns null, but in dejasmin code
    it returns Outer class?

    Outer$Inner naming convention is not used by JVM to get declaring class.
    You need to have proper InnerClasses attribute (refer to http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html#79996)
    in the generated classes. Did you check using jclasslib or another class file viewer and verified that your .class files have proper InnerClasses attribute?

  • Newbie with compilation problem

    Hi, I am trying to compile my program, and I have a problem importing a class. When I try to compile, it says:
    package org.apache.axis.encoding does not exist
    encodedImage = org.apache.axis.encoding.Base64.encode(
    I think it is quite likely something to do with the Class Path, but I do not fully understand what the class path is or does exactly? Could some one please explain the Class Path? And do I need to put another line into it?
    Any responses will be very much appreciated.
    Thank you.
    Tim.

    Basically, the classpath allows Java to locate a given class. The class path usually specifies one of two items:
    Start of compiled class directory. So, names will be resolved relative to this classpath entry. If you have a class called com.foo.testing, then whatever directory contains com/foo/testing as a directory structure in the filesystem should be a classpath entry
    External or deployed JAR files. JAR files take the compiled class directory structure (above) and places it in an archive file, like a ZIP file. (Note that a lot of other things will be in the JAR file when you deploy as a web-app, but for now, this is simple enough). Rather than specifying a directory, you have to explicitly locate the JAR file itself. So, if you have a directory of JAR files, you need to specify each one.Your classpath issue seems to me related to the JAR issue. The Apache JAR that you need has to be specified on the classpath. You normally do this by:
    java -cp [classpath entries] [fully-qualified Java class name]
    Note that classpath entries can have multiple classpath items. These are separated by a colon (in Unix/Linux) or a semi-colon (Windows).
    Hope that helps.
    - Saish
    "My karma ran over your dogma." - Anon

  • Problem with loading classes!!!

    I am loading classes using
    // Open File
    InputStream jarFile = new BufferedInputStream(new FileInputStream(
    pluginPath));
    // Get Manifest and properties
    Attributes attrs = new JarInputStream(jarFile).getManifest().
    getMainAttributes();
    jarFile.close();
    // Read Main Class
    String mainClass = attrs.getValue("Protocol-Class");
    // Load all classes from jar file without giving classpath
    URL url = new URL("jar:file:" + pluginPath + "!/");
    JarURLConnection jarConnection = (JarURLConnection) url.openConnection();
    URL[] urls = new URL[] {
    url};
    ClassLoader classLoader = new URLClassLoader(urls);
    // Create new instance of protocol
    Protocol protocol = (Protocol) classLoader.loadClass(mainClass).
    newInstance();
    I am loading classes one by one say a order A, B, C. In my case class c extends class A. So I am loading class A first and later B and finally C. But I am getting exceptions when loading class C that Class A is unknown.The following exception is thrown
    java.lang.NoClassDefFoundError: com/a/A at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    Please give me a solution to make it run.

    You create a new class loader for each class. The class loaders are independent, and so the class hierarchies they load are independent. Class A loader by classLoaderOne doesn't see class B loader by classLoaderTwo - they are loaded into their own sandboxes.
    Either load everything with one class loader or create the class loaders in a hierarchy. To create a hierarchy use the class loader constructor that takes a parent class loader as a parameter. One class loader may be easier because then you don't need to worry about loading order.

  • ABAP Objects with Workflows / Classes and Instances

    Hello,
    I am currently designing a workflow using an ABAP-Objects. So far I have been been able to get my Workflow to run with my class, but I have a couple of problems:
    - I am using the Function 'SAP_WAPI_START_WORKFLOW' to start other subflows, which enables me to decide which subflow to start at runtime. All of the subflows have standart importing-parameters in their containers, such as the key of my class. In each workflow I instantiate my class using a self-written method, which checks the table T_INSTANCES in my object, and then either returns the object reference to an existing instance or creates a new one. Obviously all of the subflows that I call from my main workflow should be able to find the instance. As far as I can see in their protocolls, this happens without any problems. The problem starts when I make changes to the instance. For example the changing of attributes (with setter methods) seems not to work. After the subflows are finished, in my main workflow, I do not see (with getter methods) any changes that has been made to the object. Is local persistence really limited to one workflow ?
    - My second problem is basically about the workflow container in workflow protocoll. In the same workflow, I can change the attributes of my object. Nevertheless, the protocoll always show the initial attribute, even though, my task with the getter-method returns the new value of the attribute.
    I appreciate any help and thanks a lot in advance.

    Hello Pauls,
    Thank you for your answer. I think we are misunderstanding each other. The problem occurs (I think) because my class is not a singleton class. Or am I mistaken ?
    When I directly start a subflow from my main workflow, then the instance that I have created in my main workflow is also visible to the subflow. As well as the static table which actually keeps track of the instances. So, in this case the subflows finds the instance and then can use the object as is.
    When I start a subflow from my main workflow using the function I mentioned above, then even though the same object key is used, there is a new instance. And the static table (I assume that you mean a static variable from type table, when you say "class table") is completely empty. In this case, my "new" instance is created which overwrites every attribute that I have set in the main workflow, before I started the subflow. More interestingly, my main workflow instantiates another new object, as soon as the subflow has finished. (I am using an event to wait for the subflow to finish.)
    On the other hand, I am not quite sure that I understood your approach with refresh and how it could help me. This method is not well documented anywhere, and all of the examples that I have found are about "leave it empty"
    As far as I understood, this method is called by the workflow between the steps, when an object is used. I slowly start to think that I need advanced information about Workflows and Memory Management.
    Thanks a lot again. Apparently, I am the only person who came across such a problem
    Greetz
    G.Fendoglu

  • Please help with simple Classes understanding

    Working further to understand Class formation, and basics.
    At the Java Threads Tutorial site:
    http://java.sun.com/docs/books/tutorial/essential/threads/timer.html
    Goal:
    1)To take the following code, and make it into 2 seperate files.
    Reminder.java
    RemindTask.java
    2)Error Free
    Here is the original, functioning code:
    import java.util.Timer;
    import java.util.TimerTask;
    * Simple demo that uses java.util.Timer to schedule a task
    * to execute once 5 seconds have passed.
    * http://java.sun.com/docs/books/tutorial/essential/threads/timer.html
    public class Reminder {
        Timer timer;
        public Reminder(int seconds) {
            timer = new Timer();
            timer.schedule(new RemindTask(), seconds*1000);
        class RemindTask extends TimerTask {
            public void run() {
                System.out.println("Time's up!");
                timer.cancel(); //Terminate the timer thread
        public static void main(String args[]) {
            new Reminder(5);
            System.out.println("Task scheduled.");
    }Here is what I tried to 2 so far, seperate into 2 seperate files:
    Reminder.java
    package threadspack;    //added this
    import java.util.Timer;
    import java.util.TimerTask;
    * Simple demo that uses java.util.Timer to schedule a task
    * to execute once 5 seconds have passed.
    * http://java.sun.com/docs/books/tutorial/essential/threads/timer.html
    public class Reminder {
        Timer timer;
        public Reminder(int seconds) {
            timer = new Timer();
            timer.schedule(new RemindTask(), seconds*1000);
        public static void main(String args[]) {
            new Reminder(5);
            System.out.println("Task scheduled.");
    }and into
    RemindTask.java
    package threadspack;  //added this
    import java.util.Timer;
    import java.util.TimerTask;
    import threadspack.Reminder; //added this
    * http://java.sun.com/docs/books/tutorial/essential/threads/timer.html
    public class RemindTask extends TimerTask
    Timer timer; /**here, I added this, because got a
    "cannot resolve symbol" error if try to compile w/out it
    but I thought using packages would have negated the need to do this....?*/
         public void run() {
                System.out.println("Time's up!");
                timer.cancel(); //Terminate the timer thread
    }After executing Reminder, the program does perform, even does the timing, however, a NullPointerException error is thrown in the RemindTask class because of this line:
    timer.cancel(); //Terminate the timer thread
    I am not sure of:
    If I have packages/import statements setup correctly
    If I have the "Timer" variable setup incorrectly/wrong spot.
    ...how to fix the problem(s)
    Thank you!

    Hi there!
    I understand that somehow the original "Timer" must
    be referenced.
    This is a major point of confusion for me....I
    thought that when importing
    Classes from the same package/other packages, you
    would have directly
    access to the variables within the imported Classes.I think you have one of the basic points of confussion. You are mixing up the concept of a "Class" with the concept of an "Object".
    Now, first of all, you do not need packages at all for what you are trying to do, so my advice is you completely forget about packages for the moment, they will only mess you up more. Simply place both .class files (compiled .java files) in the same directory. Your program is executing fine, so that indicates that the directory in which you have your main class file is being included in your classpath, so the JVM will find any class file you place there.
    As for Classes/Objects, think of the Class as the map in which the structure of a building is designed, and think of the Object as the building itself. Using the same technical map the architect defines, you could build as many buildings as you wanted. They could each have different colors, different types of doors, different window decorations, etc... but they would all have the same basic structure: the one defined in the technical map. So, the technical map is the Class, and each of the buildings is an object. In Java terminology, you would say that each of the buildings is an "Instance" of the Class.
    Lets take a simpler example with a class representing icecreams. Imagine you code the following class:
    public class Icecream{
         String flavor;
         boolean hasChocoChips;
    }Ok, with this code, what you're doing is defining the "structure" of an icecream. You can see that we have two variables in our class: a String variable with the description of the icecream's flavor, and a boolean variable indicating whether or not the icecream has chocolate chips. However, with that code you are not actually CREATING those variables (that is, allocating memory space for that data). All you are doing is saying that EACH icecream which is created will have those two variables. As I mentioned before, in Java terminology, creating an icecream would be instantiating an Icrecream object from the Icecream class.
    Ok, so lets make icrecream!!!
    Ummm... Why would we want to make several icecreams? Well, lets assume we have an icecream store:
    public class IcecreamStore{
    }Now, we want to sell icecreams, so lets put icecreams in our icecream store:
    public class IcecreamStore{
         Icecream strawberryIcecream = new Icecream(); //This is an object, it's an instance of Class Icecream
         Icecream lemonIcecream = new Icecream(); //This is another object, it's an instance of Class Icecream
    }By creating the two Icecream objects you have actually created (allocated memory space) the String and boolean variable for EACH of those icecreams. So you have actually created two String variables and two boolean variables.
    And how do we reference variables, objects, etc...?
    Well, we're selling icecreams, so lets create an icecream salesman:
    public class IcecreamSalesMan{
    }Our icecream salesman wants to sell icecreams, so lets give him a store. Lets say that each icecream store can only hold 3 icecreams. We could then define the IcecreamStore class as follows:
    public class IcecreamStore{
         Icecream icecream1;
         Icecream icecream2;
         Icecream icecream3;
    }Now lets modify our IcecreamSalesMan class to give the guy an icecream store:
    public class IcecreamSalesMan{
         IcecreamStore store = new IcecreamStore();
    }Ok, so now we have within our IcecreamSalesMan class a variable, called "store" which is itself an object (an instance) of the calss IcecreamStore.
    Now, as defined above, our IcecreamStore class will have three Icecream objects. Indirectly, our icecream salesman has now three icecreams, since he has an IcecreamStore object which in turn holds three Icecream objects.
    On the other hand, our good old salesman wants the three icecreams in his store to be chocolate, strawberry, and orange flavored. And he wants the two first icecreams to have chocolate chips, but not the third one. Well, here's the whole thing in java language:
    public class Icecream{ //define the Icecream class
         String flavor;
         boolean hasChocoChips;
    public class IcecreamStore{ //define the IcecreamStore class
         //Each icecream store will have three icecreams
         Icecream icecream1 = new Icecream(); //Create an Icecream object
         Icecream icecream2 = new Icecream(); //Create another Icecream object
         Icecream icecream3 = new Icecream(); //Create another Icecream object
    public class IcecreamSalesMan{ //this is our main (executable) class
         IcecreamStore store; //Our class has a variable which is an IcecreamStore object
         public void main(String args[]){
              store = new IcecreamStore(); //Create the store object (which itself will have 3 Icecream objects)
              /*Put the flavors and chocolate chips:*/
              store.icecream1.flavor = "Chocolate"; //Variable "flavor" of variable "icecream1" of variable "store"
              store.icecream2.flavor = "Strawberry"; //Variable "flavor" of variable "icecream2" of variable "store"
              store.icecream3.flavor = "Orange";
              store.icecream1.hasChocoChips = true;
              store.icecream2.hasChocoChips = true;
              store.icecream3.hasChocoChips = false;
    }And, retaking your original question, each of these three classes (Icecream, IcecreamStore, and IcecreamSalesMan) could be in a different .java file, and the program would work just fine. No need for packages!
    I'm sorry if you already knew all this and I just gave you a stupid lecture, but from your post I got the impression that you didn't have these concepts very clear. Otherwise, if you got the point, I'll let your extrapolate it to your own code. Should be a pice of cake!

  • Report of posted Deprecation with ASSET CLASS

    Hi Gurus,
    We require a depreciation simuation report with Asset class as mandatory one.
    Could you please tell me path and t-code for the above said report.
    Regards,
    Praveen.

    Hi Praveen,
    You mentined before you wanted to view depreciation simulation, for this RASIMU02 is the report to use.
    However, if you want to see depreciation planned /and or posted you can use the Asset Balance RABEST_ALV01. If you click on the indicator  "current book value" you will see the actually posted depreciation and current Netbook Value. Also in this report you can enter the Asset Class in the selection parameters.
    Regarding viewing the note I forwarded to you previously: you can view it via the SAP Portal - http://help.sap.com/. If you go to SAP ERP tab, you will see on the right hand side pannel a link to SAP Notes. Here you can view any note.
    I hope this helps further.
    Kind regards,
    Brigitte

  • PickList Update - Input values [...] does not match with expected class names

    Hi everybody!
    I try to update a picklist via b1if but I always get the following error-message:
    Exception : Input values '["3" , "3"]' does not match with expected class names '["com.sap.smb.sbo.api.ICompany" , "java.lang.Integer"]' for SBO object type '156'
    As you can see in the error-message I use object type 156 “PickLists”.
    Below you can see the message to the B1 Object – atom:
    <Payload id="atom1" Role="X">
        <System xmlns="">0010000100</System>
        <QueryParams xmlns="">
            <AbsoluteEntry>3</AbsoluteEntry>
        </QueryParams>
        <PickLists xmlns="">
            <row>
                <PickDate>20120914</PickDate>
            </row>
        </PickLists>
        <PickLists_Lines xmlns="">
            <row>
                <OrderEntry>248</OrderEntry>
                <OrderRowID>0</OrderRowID>
                <PickedQuantity>1</PickedQuantity>
            </row>
        </PickLists_Lines>
    </Payload>
    …and the result:
    <Payload status="success" id="atom2" Role="C" DImsg=" Exception :
    Input values '["3" , "3"]' does not match with expected class names
    '["com.sap.smb.sbo.api.ICompany" , "java.lang.Integer"]' for SBO object type '156'"
    DIresult="failure" keyvalue="3" keyname="AbsEntry" payload="atom1" objectid="156"
    method="Synchronous Update" b1login="Technical User" system="0010000100"/>
    I just can’t figure out meaning of the error-message…anyone can help?
    Thanks in advance!
    Best Regards
    Alex

    Hey Alex,
    I have a similar problem. I suppose you have solved your problem, because this post is very old. Perhaps you could share the solution?
    Best regards
    Benjamin

  • Newbie with a Motif ES8 - optimum setup with a minimalistic approach?

    hi,
    I'm trying to decide on the optimum setup with a minimalistic approach!
    I a newbie with the Motif ES8 and am at cross roads deciding on the type of computer setup for my VST.
    PC + Cubase vs. MAC + Logic Pro or Logic Pro Express?
    With MAC, how far do I need to go;i.e. MACBook Pro a must?
    how many USB ports (types 400 vs 800), etc?
    With Logic Pro, is Express going to be sufficient for a full soup to nuts recording and mastering given that this is for a home studio setup though with an idealist running it?
    I'm a one woman show and so don't need too many inputs/outputs. I'd be recording a track at a time and my songs take up less than 16 tracks.
    I would really appreciate any and all responses.
    Roya
    macbook pro   Mac OS X (10.4.7)  

    thanks for the detailed response PK
    so, the extra USB port on the HD would facilitate a
    hub type interface i.e. once you hook up another\
    device to the HD via USB, you're really hooked up to
    the computer.. right? and so, if I get a powered USB
    Hub, this wouldn't really matter.. correct?
    For the most part, you have to be careful hooking
    too many devices up to a computer WHEN you are trying
    to do some sound work. When they say a computer
    can do ABC we sometimes think that should include D.
    As for the sound interface, I already have an
    Audiophile that has midi in/out, firewire to
    computer, RCA jack for i/o. I know its not the high
    end stuff but I hope to do a stepwise upgrade here if
    at all possible..
    That actually might work, if it supports at least
    16 bit 44.1 khz that is the lowest you want to go.
    Ideally it should be 24 bit to take advantage of Logics
    24bit environment. You might be able to run the ES8
    straight into those RCA jacks if they are SPDIF and your
    keyboard has the same on the back.
    There are a bunch of people on Motifator discussion
    groups that warn against Apple's lack of support for
    Logic. Not sure if the concern is only regarding the
    combination of Yamaha (Motif) and Apple (Logic).
    I went and read that thread, here are some of my thoughts
    on some of this.
    Can't comment on MAC, but a dear friend of mine who is an audio engineer said >he had walked away from Logic after Apple bought them out. "Straight downhill" >I think is how he put it.
    Many windows users just hate Apple and their products.
    I think much of it is ignorance. They will say
    Macs are junk but when I ask them why
    they never have an answer or say something
    that is false. It sounds like this "professional"
    did not even wait to see that Logic did get better.
    Apple charges 200.00 for support of it's Professional
    applications. You really do not need it since there are
    so many experienced Logic users here that I never had
    a question go unanswered. I've noticed on those forums
    the same small group of people do most of the problem
    solving. I am not overly impressed with Yamaha's support.
    I had my questions about my keyboard answered quicker
    by those forums. So I guess both companies need work
    in this area. Frankly, for recording, I think the Motif
    and Logic are a Killer combination. Both have steep
    learning curves but once you get up to speed I think
    the results speak for themselves. The main difference
    in my opinion is that the Motif is the ultimate
    performance tool and Logic is the ultimate studio toolshop.
    After having a Motif for over a month, I am convinced
    it has a steeper learning curve than Logic take for instance
    that thread on getting your keyboard to record it's own
    audio output. The list of things to do each time is as long
    as my arm. In case you did not read it here it is.
    First thing – STORE your MIX setup and SAVE the Song to SmartMedia (or USB mass storage device) before resampling it so you have a backup. You would create a mix to balance the instruments the way you like them.
    * Select a target track, then press the [INTEGRATED SAMPLING] button.
    Setup the parameters for resampling:
    * Press [F1] DEST
    * Select a TRACK and [KEYBANK] (note) into which you will record the resampled data. You can target either an empty track or the track on which you are going to play (if you are going to play along). If all tracks are full, don't worry, you can still resample anyway.
    * Press [F2] SOURCE. Set the source parameters as follows:
    - Type = Sample - with this type the Integrated Sampling Sequencer will not create any NOTE-ON data in your sequencer, it will just simply add a new sample waveform to the waveform list
    - Source = Resample
    - Mono/Stereo = Stereo
    - Next = OFF
    - Frequency = 44.1k
    * Press [F6] REC This will place the sampling sequencer in Standby mode. Set the TrggrMode paramter to Manual
    * Press Start on the sequencer and check your levels. If too low set the REC GAIN higher +6bB or +12dB, if the level is to high (clipping- you will see a lightning bolt) lower the GAIN to -6dB or -12dB. When you have checked the levels, press STOP and return to the top of the SONG.
    * Press F6 REC to start the Resample, Press [>] (play) to begin recording the resample. The Motif ES will draw the wave as it samples.
    * When the song is over press [F6] STOP. The Motif ES will take a few moments to gather the data.
    To create the .wav file:
    * Press [FILE]
    * Press [F1] CONFIG
    * Press [SF1] CURRENT
    * If you will be saving the resampled song to a SmartMedia Card set the Current parameter to CARD. To save to a USB device, set this parameter to USB
    * Press [F2] SAVE
    * Set the data TYPE field to WAV
    * Cursor down and Name the wave
    * (If desired, navigate to the subdirectory where you want to save the *.wav file.)
    * Press [ENTER]
    * The ES will ask you which TRACK and NOTE to save as a wave file. Enter the values you selected as the sample destination in the procedure above.
    * Press and hold the AUDITION button to make sure your sample is there.
    * Press [ENTER] and the Motif ES will export the sample as a .wav to your SmartMedia card or USB device.
    Once you have configured Logic which are takes about
    3 minutes (and only has to be done once)
    and set up the keyboard which takes 30 seconds.
    (this has to be done once for each session)
    you plug your keyboard into your audio interface then
    Hit Record
    that is the whole list, two words.
    Once it is in Logic, you have many way to edit it
    and process if needed. The midi is much
    easier to manipulate and there are more
    ways than the ES has keys. Plus you can add to the
    sounds with the internal instruments which are
    as sophisticated and as high quality as the ES.
    Then if your happy with it you can create MP3's
    and burn Red book compliant CD's for
    commercial duplication.
    It really is a complete setup.
    But at any rate I'm going to do some more research on
    another scenario, i.e. what about MAC and Cubase? As
    you may know Yamaha just acquired Cubase..
    I dont think I would be the best to comment on that.
    Maybe ask one of the Gurus on the unofficial
    website for Cubase, The Cubinator.
    Sorry, I just couldn't resist.
    you've been very helpful - thanks again
    cheers,
    Roya
    Cheers!
    P.S. I agree with Dave, If you have a Macbook
    Pro you dont need another computer. If you
    wanta desktop whatever reasons I understand
    Oh and btw, what's QWERTY?
    They are the first 6 keys (top row/left to right)
    on your computer keyboard

Maybe you are looking for

  • DMA RT to FPGA guaranteed order?

    I have a question regarding the sending of data via FIFO to an FPGA card via DMA.  I would assume that if I have several locations in my RT code sending data via DMA FIFO that it is still guaranteed that any given DMA Transfer (let's say 12 data valu

  • Fields for a Purchase order

    Hi, I have got a requirementon smartform, but I have not received Fields. Could anybody give me the fileds for a Purchase order Like :                 SERVICE ORDER             - ?      SERVICE Technicain Name -  ?      Sales Order             - ?   

  • Multiple Sprymenu bars, submenu's apearing on top of page

    Hi, I need to use multiple sprymenu's for one website. So I created them and made multiple stylesheets for every bar one. In Firefox everything is working great but (offcorse) in IE it isnt. The top one is working good in IE but the following ones no

  • Regular expression in 1.4

    Hi! I am using the 1.4 jsdk regular expressions macthes() method and can't figure out what is the exact meaning of "macthing " this method have. here are some weard things: #         regexp                        string                  matches/does

  • Bad Firewire Port?

    I'm having problems with the three external HDs I use with my MBP; one's a WD Passport 500, the other two are LaCie Ruggeds. I load them with media and use them as scratch disks to edit in Final Cut. Sometimes... SOMETIMES... they mount. But then, af