Upload
angelia-nicole-dela-cruz
View
869
Download
1
Tags:
Embed Size (px)
Citation preview
Java Programming Language
References:http://docstore.mik.ua/orelly/java-ent/jnut/ch01_02.htmJava For Dummies 4th Edition by Barry Burdhttp://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2Bhttp://en.wikipedia.org/wiki/Comparison_of_Java_and_C_Sharphttp://en.wikipedia.org/wiki/Garbage_collection_(computer_science)http://en.wikipedia.org/wiki/Java_package
public class Greeting { public void greet() { System.out.println("hi"); }}
This is the core value proposition of the Java platform. It is basically writing a code once. After creating a code, you can already run it on anywhere.
Java has a strong security wherein it allows the users to download suspicious codes over a network then runs it in a secured environment. Secured in a sense that it cannot do any harm to the system because Java’s security prevents it from infecting the system with a virus.
Classes are stored in separate files and are only loaded into the Java interpreter when needed.
These also refers to Java Packages which are compressed as JAR files which allows faster downloading of classes as a group instead of as a file.
Sample: import java.awt.*; import java.awt.event.*;
Garbage collection is a form of automatic memory management and Java uses it as a means of reclaiming memory instead of deallocation of memory.
public DelaCruzAngeEncoder() throws IOException
{
//bufferedreader in order to read and print file
//inputstreamreader to locate the input file location
int ctr = 0;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter file location: ");
String file = in.readLine();
in.close();
BufferedReader rdr = new BufferedReader(new FileReader(file));
String str;
while((str = rdr.readLine()) != null)
{
System.out.print(++ctr + ": ");
for(int i = 0; i < str.length(); i++)
{
if (result(str.toCharArray()[i]) == false)
{
System.out.print(str.toCharArray()[i]);
}
}
System.out.print("\r\n");
}
rdr.close();