Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Spelling counts if you do Main then it will not work
- * string is the return type
- * **********************************************
- * BACON BACON *
- * BACON BACON *
- * BACON BACON *
- * BACON BACON *
- * BACON BACON *
- * BACON BACON *
- * BACON BACON *
- * *
- * *
- * BACON BACON *
- * BACON BACON *
- * BACON BACON BACON BACON *
- * BACON BACON BACON BACON *
- * BACON \ *
- * BACON \ *
- * BACON *
- ************************************************
- * Java is an object oriented program
- * objects tell you what the thing should know.
- * you can make a object of a class
- * Concatonation is the child of another parent
- * every class inherit the parent class
- *
- * String is a class
- *
- * primitives are never capatilized
- * int
- * double
- * char
- *
- */
- public class concatonations {
- public static void main (String [] args){
- System.out.println("This class concatonation string");
- String s = concatOne();
- double d = concatTwo();
- System.out.println( s + d); // this is concatonation
- }
- public static String concatOne()
- {
- /*
- * void is in place of the return type if you don't ever want a return type.
- */
- String alpha = " Awesome "; //literal strings are the ones that are in quotes
- String beta = " Better ";
- return(alpha + " " + beta); //the blue sign is the concatonation symbol.
- }
- public static double concatTwo()
- {
- int first = 6;
- double second = 10;
- double third = 15.5;
- System.out.println(" The sum of two numbers is " + (first + second));
- return(first + second);
- //this +sign is not a concatonation sign
- /**
- * NOTICE int + double = double
- * Any line after a return statement is not used.
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement