Skip to main content

Posts

Showing posts from December, 2018

Java switch case explanation and sample program.

Introduction :-        Today we shall , see another topic about the conditional statements which is the switch case. So in the post there will be the a sample program  and the same sample program's download link is provided . Feel free to have changes in the code and if you wish to share the modified code , share it in the comment section . What is the switch case basically ?     Switch case is similar to the if-else only the change is that it will change according to the condition in the switch block there will be multiple case which are will evaluate according to the switch condition. What is the syntax of the switch case ? Syntax :- switch(expression) {    // case statements    // values must be of same type of expression    case value1 :       // Statements       break; // break is optional        case value2 :       // Statements       break; // break is optional        // We can have any number of case statements    // below is d

Java if-else ladder with a example program.

Introduction:-   Today we shall check about the if-else ladder it is simlar to the if-else statement only the difference is that we can combine a if statement with the else we should have a example program with the syntax and whole bunch of stuff . We also provide a download link in bellow . You are free to change the code and if you wish to share the modified code share with us in the comments. What is the Syntax of the if -else ladder or if -else if ?   Syntax:-    if(Condition){     Statement 1      Statement 2      Statement 3   ..............    } else if(condition){    Statement 1    Statement 2    Statement 3   ................. } else{     Statement 1     Statement 2    Statement 3   ................ }    How to write the java program code for the ladder ? Code Statement :- Program to find greatest of the three number using if -else ladder. Code:-   class condition1{   public static void main(String[] args){

Java if-else statment with example program.

Introduction:-     Today we will be having a look on the java if-else statement and we shall see a sample program a new thing about this post that there will be a download link to the source- code of the program so you can have full access to the code .To implement your programing skills on it and if you wish to share the code genrated by you feel free to comment down below. What is if-else statement?    if-else statement is basically the conditional statement where only one we be executed if the condition evaluates true the code inside the if statement shall be executed or if the condition evalutes false the else statement shall be executed . Now the condition is written inside the if statement and there is no condition in the else block. What is the syntax of if-else in java? Syntax:-   if (condition){     statement 1     statement 2     statement 3    .............  }  else{  statment 1  statement 2    .............  }   So the above given

To implement a simple java program Hello Java.

Introduction:-     Today we shall be writing a java program to see how the program is writen in java and the basic of java shall be discussed in this post here will will be writing and executing the program I will show you the output . All the steps will be shown simultaneously. Writing a hello java program. class hellojava{   public static void main(String[] args){      System.out.println("Hello Java");   } } Step 1: Copy the upper program in a notepad file and then save it as hellojava.java with changing the text file to all files. Note : That the file name should be save as the class name because java is case sensitive . Step 2: Fire up your cmd as Adminstrator and then change the path to the saved java file . (To change the path type in the cmd as cd <path to the java file> ) Step 3: To Compile the java program type in the command " javac hellojava.java ".By execting the upper command the javac create a bytecode which is k

Setting up java on local machine Part 1.

Introduction:-      So to set up the JAVA development enviorment we need do some setting which are basically easy. There can be of two setups which are the :-      1.  Command prompt (Actually the cmd setup)      2.  The IDE (Which are freely and licnesed) So in this post we will be seeing the Command prompt setup. What are the requirment for the setup?   The requirments for the setup are the to easy there is no back techno knowledge for the setup it is the basic requirment.   1. Internet Connection(To download the java development kit)   2. Adminstrator privilages Where to download the JAVA DEVELOPMENT KIT(JDK) ?   The JDK is nothing but a set of java tools that are given in the java standard edition which are freely downloadable from the  offical oracle site the current jdk version is 11 and by the time there shall be updates to the jdk for the time being it is the 11 edition. The fully steps for the download path is as bellow Step 1: To download rhe JDK  Click