



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




//******************************************************************** // Lincoln.java Java Foundations // // Demonstrates the basic structure of a Java application. //******************************************************************** public { class Lincoln //----------------------------------------------------------------- // Prints a presidential quote. //----------------------------------------------------------------- public static void main (String[] args) { System.out.println ("A quote by Abraham Lincoln:"); }^ System.out.println^ ("Whatever^ you^ are,^ be^ a^ good^ one."); }
//******************************************************************** // Addition.java Java Foundations // // Demonstrates the difference between the addition and string // //******************************************************************** concatenation operators. public { class Addition //----------------------------------------------------------------- // Concatenates and adds two numbers and prints the results. //----------------------------------------------------------------- public static void main (String[] args) { System.out.println ("24 and 45 concatenated: " + 24 + 45); }^ System.out.println^ ("24^ and^45 added:^ "^ +^ (24^ +^ 45)); }