Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Computers for Beginners (https://www.askmehelpdesk.com/forumdisplay.php?f=79)
-   -   Java (https://www.askmehelpdesk.com/showthread.php?t=834829)

  • Oct 9, 2017, 04:38 PM
    RASBAR
    Java
    On your computer c: drive create a folder called myjava. Save the following code in a file called DataWork.java inside the myjava directory and make changes in that file in the places as given below each commented section. Then save the file.
    Open a command prompt and cd c:\myjava. Then compile by giving the javac DataWork.java command on command prompt.
    Run by giving command java DataWork Make sure no errors and fix if any.
    Save the code in jGRASP, then save it in c:\myjava and run it.
    /*******************
    Name:
    Date:
    Notes:
    *******************/

    public class DataWork
    {
    // create 4 variables of different data types
    // Example: private int count;

    public void compare()
    {
    // Use two different comparison operators for each data type declared
    // and print the output for each of those
    // Example: System.out.println(" count > 5:"+(count > 5));
    }

    public static void main (String args [])
    {
    DataWork dw = new DataWork();
    dw.compare();
    }
    }

  • All times are GMT -7. The time now is 07:39 AM.