java
Today we will start coding java , but first we must explain some important thing and principles
Package : is a mechanism to encapsulate a group of classes, sub packages and interfaces and package can be used for
- Preventing naming conflicts
- Making searching/locating and usage of classes, interfaces, enumerations and annotations easier
- Providing controlled acces
- Built-in Packages : These packages consist of a large number of classes which are a part of Java API ( java.lang , java.io , java.util)
- User-defined packages : These are the packages that are defined by the user
Method : is a collection of statements that are grouped together to perform an operation
Compiler : is a program that takes the text file work of a developer and compiles it into a platform-independent Java file. Java compilers include the Java Programming Language Compiler (javac), the GNU Compiler for Java (GCJ), the Eclipse Compiler for Java (ECJ) and Jikes.
Error in programming :
- Syntax errors : These are errors where the compiler finds something wrong with your program, and you can't even try to execute it
- Runtime errors : Java may detect an error while your program is running
- Logic errors : logic error, or bug, is when your program compiles and runs, but does the wrong thing. The Java system, of course, has no idea what your program is supposed to do, so it provides no additional information to help you find the error
this is the code , and we explain it on the video bellow
public class test{
public static void main(String[]args){
System.out.println("____________________________________________________________________");
System.out.println();
System.out.println(" Wellcome To Java");
System.out.println();
System.out.println("____________________________________________________________________");
System.out.println();
System.out.println();
System.out.println();
System.out.println();
}
}
public static void main(String[]args){
System.out.println("____________________________________________________________________");
System.out.println();
System.out.println(" Wellcome To Java");
System.out.println();
System.out.println("____________________________________________________________________");
System.out.println();
System.out.println();
System.out.println();
System.out.println();
}
}
watch on YouTube