Methods perform operations on fields, methods have the following -Constructors initializes the state -accessor method check the sate of the fields -muatator methods changes the state -utility methods performs Wrap all of this into one class and you have your … [Read more...] about What’s a method in java?
Java
What are legal variable names in java
Variable names are case-sensitive. A variable's name can be any legal identifier — an unlimited-length letters and digits, beginning with a letter, the dollar sign "$", or the underscore character "". The convention, however, is to always begin your variable names … [Read more...] about What are legal variable names in java
what are objects in java?
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 / … [Read more...] about what are objects in java?
How to do addition in java?
I imported a class with the import java.util.Scanner; it seemed a little awkward to do in java, so used to C. import java.util.Scanner; // class scanner gets imported public class addition { public static void main(String [] args ) { Scanner input = … [Read more...] about How to do addition in java?
Creating a multiplication table in java
/** * Multiplication table */ public class tables { public static void main(String[] args) { //print header System.out.println("Multiplication Table:"); for (int k = 0; k <= 10; k++ ) { for(int j = 0; j <= 10; j++) { System.out.print( (j * k ) + "\t" … [Read more...] about Creating a multiplication table in java
how to work with character values?
public class Main { public static void main (String[] args) { char d1 = '1'; char d2 = '2'; char d3 = '3'; system.out.print(c1); system.out.print(c2); system.out.print(c3); } } … [Read more...] about how to work with character values?
general rules of java operators
so what are some of the java operators? i have broken down the values as follows in this list assignment this is the most common operator '=' equal '+' addition '-' subtraction '*' multiplication '/' division '%' modulist … [Read more...] about general rules of java operators
How to use primitive data types downward in java?
Java is really picky on how primitive data types get converted downward so in that case java requires you to be very explicit on how the change is done when going downwards, and once again we are going to list the data types.. double x64 bits float … [Read more...] about How to use primitive data types downward in java?
How to use primitive data types in easy steps
How to convert primitive data types upward? This a list of order primitives from biggest to smallest double x64 bits float long int short byte So how do you convert primitive data types upward you must first understand the data types … [Read more...] about How to use primitive data types in easy steps