• Skip to main content
  • Skip to primary sidebar

Founder at work

Master the skills to create and launch your next SaaS company

  • About Me
  • Reviews
  • Resources
  • Community
  • Contact
  • Lessons
  • Series
  • Search
  • Login

what are objects in java?

September 5, 2012 by Rick Hernandez Leave a Comment

objects have the following
-attributes/ data
-behaviors/ operation

anytime a division is done you get a quotient and remainder in java.

Addition gives you an int back
subtraction gives you a int back
multiplication gives you a in back

% —Modulus
/ —Division

What are real numbers?
any rational or irrational number

integer division vs floating point division
late night talk do the operators have two different set of sequence for solving the same problem?
why yes they do completely different.


// example for 9-5-12

public class Example1
{
  public static void main ( String [] args )
  {
    
    double a = 5.2665;
    double b = 2.3232;
    double result;
    
    result = a + b;
    System.out.printf("%.2f + %.2f = %.2f\n", a, b, result);
    
    result = a - b;
    System.out.printf("%.2f - %.2f = %.2f\n", a, b, result);
   
    result = a * b;
    System.out.printf("%.2f * %.2f = %.2f\n", a, b, result);
   
    result = a / b;
    System.out.printf("%.2f / %.2f = %.2f\n", a, b, result);
    
    result = a % b;
    System.out.printf("%.2f %% %.2f = %.2f\n", a, b, result);
    
  }// end of void main
}//end of classs Example

repeat this ten times
<color=red>

“every expression has a value”

</color=red>
-variables are expressions
-formulas

var = var mathOperation expression

// class example2 for 9-5-12

public class Example1
{
  public static void main ( String [] args )
  {
    
    double a = 5.2665;
    double b = 2.3232;
    double result =  1;
    
    result += a + b;
    System.out.printf("result = %.2f\n", result);
    
    result -= a - b;
    System.out.printf("result = %.2f\n", result);
   
    result *= a * b;
    System.out.printf("result = %.2f\n",  result);
   
    result /= a / b;
    System.out.printf("result = %.2f\n",  result);
    
    result %= a % b;
    System.out.printf("result = %.2f\n", result);
    
  }// end of void main
}//end of classs Example

Rick Hernandez

I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related

Filed Under: Java, Programming

Primary Sidebar

Learn How To Take Your Idea And Convert It Into An App From Scratch Even If You Have Never Written A Single Line Of Code.

  • How to Find Your Next Great App Idea
  • The Secret To Getting PAID To Build Your Own App
  • How To Create Your App (SaaS, Mobile, VR, AR, Game)
  • How To Monetize Your Apps
Learn More
4.82 Ratings

Copyright © 2025 · JSecademy Blog Theme on Genesis Framework · WordPress · Log in