Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Tuesday, 28 November 2017

What is Java


Java is a programing language purpose computer programming language that is concurrent, class-based, object-oriented and specifically designed to have as few implementation dependencies as possible. Java can be write once and run anywhere(WORA). Meaning that compiled Java code can run on all platforms that support Java without the need for recompilation

Code Structure in Java

Source file

Source file holds one class definition. The class represents a piece of your program, although a very tiny application might need just a single class. Source file code with .java extension .

Class 

Java class file is a file (with the .class filename extension) containing Java byte code that can be executed on the Java Virtual Machine (JVM). A Java class file is produced by a Java compiler from Java programming language source files(.java files) containing Java classes.The class must go with a pair of curly braces({}). A class has one or more methods.

Method

method is a set of code which is referred to by name and can be called (invoked) at any point in a program simply by utilizing the method's name. Think of a method as a subprogram that acts on data and often returns a value. Each method has its own name. Method code is basically a set of statement and for now you can think a method kind of like a function or procedure.