Posts

Java Basics For Beginners - 01 Class | Interface | Abstract Class

Image
 Basic Building Blocks of Java  Class Class is the blueprint of an object. Let's explain this from a real-world example. For that, we will consider the Fish category. Fish is a common category it has specific behaviors and states. In the real world, we can see the implementation of Fish such as TankCleaners, Goldfish, and so on. This Fish is virtual and has specific behaviors and states but has no implementation of the behaviors. We cannot define the implementation of Fish behaviors because it is common. In java to define those virtual things, we use Interfaces. We cannot build an active object from the Interfaces. It is as we cannot find Fish in the real world there are only TacnkCleaners, GoldFish, and so on.  In java to define the structure of real-world existing things, we use class .  class GoldFish {     String color ;     public void swim (){         System . out . println ( "Gold fish swim in this way..." );   ...

How to Write First Java Program

Image
How to setup my computer for Java programming Step 01 Install JDK on your computer. You can download Java from here . Configure Environment variables for java. Then you can compile and run java application from anywhere in your computer. On windows10 you can configure environment variables for java as follows. In Environment Variables under User variables click on New Enter JAVA_HOME as variable name Enter path to the JDK as variable value.Ex: Locate the PATH variable Append the PATH to the JDK/bin folder as the PATH Value. Ex: C:\Program Files\Java\jdk1.8.0_241\bin Repeat same steps for the System Varibles. Click OK to apply the settings. To check enviornment variable setup open command prompt and type javac then hit enter if output as follows then path configuration is success. Now you can compile and run java program from anywhere in your computer.  Step 02 Install IDE for java codding. This can be NotePad, VisualStudioCode, Eclipse, Intelij or any other IDE. If you are a b...

Why Java is Platform Independent ?

Image
 In java, we can write one application and have it work on any device but the running device should have installed the Java Virtual Machine(JVM/JRE).  1- Create a source file using java protocols and syntax.JDK should be installed on the source code writing machine. The source file should save with the .java file extension. Let's assume we save the source file as test.java . 2- Compiling process also happens within the same machine that we use to write Java source code. javac which is located inside the JDK will do its task to compile the Java source code(Here it is test.java) and then convert the java source code to bytecode. . If the source file doesn't have any errors then java compile creates another file as test.class .  ".class" is the file extension of compiled bytecode file.   3- We can take the test.class file out from the source code development machine and can run on any device which has installed JVM. 4- We can run test.class file(Java bytecode) on...

Prerequisite to learning Java | Programming language

To start to learn java no prerequisites are needed. But if you have some of the following knowledge it will help you to easily catch up with the Java theoretical things.  Basic computer operating knowledge. What is a Programming language? How do program codes convert to machine-readable code? Process of converting human-readable code to machine-readable codes in Java? What is a programming language? Programming language is a kind of language which is used by programmers to communicate with computers. In real-world language is used to communicate with two parties in order to share their thoughts, feelings, knowledge, and so on.  Programming languages like C, C++, Java, Python, C# are used by computer programmers to build kinds of softwares by givng instructions to the computers. Programming languages can be mainly categorized into two. Low-Level Programming Language. High-Level Programming Language. 1. Low-Level Programming Language. Low-level languages use machine codes (0 and...

Java Certification Exams

 When Sun microsystems own java they use to have two java certification exams. SCJP (Sun Certified Java Programmer) - For Java Programmers. SCJA(Sun Certified Java Programmer) - For those who wanted broader knowledge. After Oracle brought Sun microsystems they changed all java exams names from java to oracle. SCJP to OCJP SCJA to OCJA But with Java 7 oracle decide to stop updating OCJA exam and decided to cover more on the programmer space and split it into two exams. OCJA split into two as follow :  OCA JP - Oracle Certified Associate Java Programmer also known as Java Programmer I or OCA. OCPJP - Oracle Certified Professional Java Programmer also known as Java Programmer II or OCP. There is an upgrade exam in case you took an older version of SCJP or OCJP and want to upgrade. Most people refer to the current exam as OCA 8, OCP 8, and Java 8 upgrade exam.  These are the certification exams oracle use to certified you about your java programming language knowledge. Links:...

History of java

  Java is an object-oriented programming language. Java compiler compiled source code to bytecode and is then run by a Java Virtual Machine. Java is developed as the enhancement of C and C++ programming language. Java programming language was started as a project called "Oak" by James Gosling and the team called as Green Team at Sun Microsystems in June 1991.  James Gosling is the father of the Java programming language.  Sun Microsystems( Now owns by Oracle Corporation) released Java progeamming language(version 1.0) in 1995.  Java Programming Language Version History JDK Alpha and Beta (1995). JDK 1.0 (23rd Jan 1996). JDK 1.1 (19th Feb 1997) J2SE 1.2 (8th Dec 1998) J2SE 1.3 (8th May 2000) J2SE 1.4 (6th Feb 2002) J2SE 5.0 (30th Sep 2004) Java SE 6 (11th Dec 2006) Java SE 7 (28th July 2011) Java SE 8 (18th Mar 2014) Java SE 9 (21st Sep 2017) Java SE 10 (20th Mar 2018) Java SE 11 (Sep 2018) Java SE 12 (March 2019) Java SE 13 (Sep 2019) Java SE 14 (Mar 2020) Java SE 15...