Breaking News

Search This Blog

Showing posts sorted by relevance for query Java. Sort by date Show all posts
Showing posts sorted by relevance for query Java. Sort by date Show all posts

Monday, September 3, 2018

7:42 AM

Java Program to Check if a Given Integer is Odd or Even

Java Program to Check if a Given Integer is Odd or Even in Hindi/English



This is a Java program to check whether a given integer is odd or even.
Enter an integer number as input. Now we check our balance with the module operator two. If the balance is zero then the given number is also. If the remainder is 1 then the given number is odd. So we show the production according to the rest

Here is the source code of the Java program to check that a given integer is strange or even. The Java program is successfully compiled and run on the Windows system. Program output is also shown below.

यह एक जावा प्रोग्राम है यह जांचने के लिए कि क्या एक दिया गया इंटीजर विषम या यहां तक कि है।
इनपुट के रूप में कोई पूर्णांक संख्या दर्ज करें। अब हम अपने शेष को मॉड्यूल ऑपरेटर के साथ दो से जांचते हैं। यदि शेष शून्य है तो दिया गया नंबर भी है। यदि शेष 1 है तो दिया गया संख्या विषम है। इसलिए हम शेष के अनुसार उत्पादन दिखाते हैं

जावा प्रोग्राम का स्रोत कोड यह जांचने के लिए यहां दिया गया है कि एक दिया गया पूर्णांक अजीब या यहां तक कि है। जावा प्रोग्राम सफलतापूर्वक संकलित और विंडोज सिस्टम पर चलाया जाता है। कार्यक्रम आउटपुट भी नीचे दिखाया गया है।

Program:-

class evenodd
{

 public static void main(String a[])

{

int b=5;

if(b%2==0)

{

System.out.print("number is even");

}
else
{

System.out.print("number is odd");

}
}
}


Output:-




even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,even odd program in java,

even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,even odd program in java in hindi,

Saturday, August 11, 2018

2:13 AM

how to run java program in CMD

how to run java program in CMD


It's a First Program Of Java⬇

class Suryansh
{
public static void main(String a[])
{
System.out.println("hello");
}
}



format of save the java program & Important points

  format:  classname.java

{ first letter of class name is always capital } 
{class name and file name is always same }
ex: Suryansh.java,Technical.java

Save this file on C, D,E,F etc drive . before run the java program first set the Environment path .

 OutPut



Compile the Program

we will use the javac command[CMD] to convert your Java program into a form more amenable for execution on a computer.


        first open CMD

C:\Users\username>d: {drive name}


D:\>cd java {folder name when program is saved} 

Assuming the file, say  Suryansh.java, is in the current working directory, type the javac command give space and your program name.

    D:\java>javac Suryansh.java 

    write our java & our program name with out ".java" 


      If everything went well, you should see no error messages.

        Execute the Program
        You will use the java command to execute your program.
        From the Command Prompt, type the java command below.
        D:\java>java Suryansh
        Hello

        If all goes well, you should see the output of the program - Hello




          how to run java program in cmd using notepad,how to run java program in windows 7,how to run java program in windows 10,how to run java program in ubuntu,run java from command line mac,how to run a java program in terminal,how to run java program in eclipse,java command
          We use Java compiler javac to compile Java program and the Java interpreter java to run the Java program. ... Save your file as HelloTesters.java in C:\SoftwareTestingMaterial. ... Step iv: Run the created Java program using command prompt.,

          how to run java program in cmd using notepad,how to run java program in windows 7,how to run java program in windows 10,how to run java program in ubuntu,run java from command line mac,how to run a java program in terminal,how to run java program in eclipse,java commandWe use Java compiler javac to compile Java program and the Java interpreter java to run the Java program. ... Save your file as HelloTesters.java in C:\SoftwareTestingMaterial. ... Step iv: Run the created Java program using command prompt.,
          how to run java program in cmd using notepad,how to run java program in windows 7,how to run java program in windows 10,how to run java program in ubuntu,run java from command line mac,how to run a java program in terminal,how to run java program in eclipse,java command
          2:07 AM

          Hello : How to Create Your First Java Program

          Hello : How to Create Your First Java Program



          Hello : How to Create Your First Java Program


          It's a First Program Of Java⬇

          class Suryansh
          {
          public static void main(String a[])
          {
          System.out.println("hello");
          }
          }



          format of save the java program & Important points

            format:  classname.java

          { first letter of class name is always capital } 
          {class name and file name is always same }
          ex: Suryansh.java,Technical.java

          Save this file on C, D,E,F etc drive . before run the java program first set the Environment path .

           OutPut


          Compile the Program

          we will use the javac command[CMD] to convert your Java program into a form more amenable for execution on a computer.


                  first open CMD

          C:\Users\username>d: {drive name}


          D:\>cd java {folder name when program is saved} 

          Assuming the file, say  Suryansh.java, is in the current working directory, type the javac command give space and your program name.

            D:\java>javac Suryansh.java 

            write our java & our program name with out ".java" 


              If everything went well, you should see no error messages.

                Execute the Program
                You will use the java command to execute your program.
                From the Command Prompt, type the java command below.
                D:\java>java Suryansh
                Hello

                output of the program - Hello




                  --------------------------------------------------------------------------------------------------------------------------
                  ========================================================================





                  The first step creates the program; the second translates it into a language ... A compiler is an application that translates programs from the Java language,Write your first Java program. This tutorial explains with example steps to compile and run hello world program.,

                  simple java program examples for beginners,java programs,hello world program in java using notepad,list of java programs,java programs examples with output,how to run java program,java hello world tutorial,java program to add two numbersThe first step creates the program; the second translates it into a language ... A compiler is an application that translates programs from the Java language,Write your first Java program. This tutorial explains with example steps to compile and run hello world program.,
                  simple java program examples for beginners,java programs,hello world program in java using notepad,list of java programs,java programs examples with output,how to run java program,java hello world tutorial,java program to add two numbers

                  Saturday, September 8, 2018

                  4:23 AM

                  For Loops in java [hindi and english both]


                  For Loops in java [hindi and english both]

                  Repeat repeating the same statement is 'looping'. In Java, three types of loops work.
                  वही एक कथन दोहराएं दोहराएं 'लूपिंग' है। जावा में, तीन प्रकार के लूप काम करते हैं।
                  • .    for Loop
                  • .     while Loop
                  • .    do_while Loop

                  1. for Loop
                  Core Java has two types for for loop.
                  कोर जावा के लिए लूप के लिए दो प्रकार हैं।
                  1.   "Normal for Loop".
                  2.   "Enhanced or foreach Loop".


                  1.1 Normal for Loop
                  The statement repeats until the condition given for for the loop.
                  लूप के लिए दी गई स्थिति तक बयान दोहराया जाता है।


                  Syntax for for Loop
                  for( initialization; condition; increment/decrement ){
                         
                          //statements;
                  Example for for Loop
                  Source Code :
                  public class_ForLoop
                  {

                      public static void main(String args[])
                  {
                         
                          for( int i=0; i < 10; i++ )
                  {
                                System.out.println("Value of i is " + i);
                  }
                  }
                  }



                  Output :

                  Value of i is 0
                  Value of i is 1
                  Value of i is 2
                  Value of i is 3
                  Value of i is 4
                  Value of i is 5
                  Value of i is 6
                  Value of i is 7
                  Value of i is 8
                  Value of i is 9
                  1.2 Enhanced or foreach Loop
                  Foreach is used to print the value of the elements in an array, but it is better than for the loop in case of array.
                  Foreach का प्रयोग किसी सरणी में तत्वों के मान को मुद्रित करने के लिए किया जाता है, लेकिन सरणी के मामले में लूप के लिए यह बेहतर है।
                  for(variable_name : array_name){
                         
                          //statement(s);

                  }


                  Example for foreach Loop
                  Source Code :

                  public class ForandForeachLoop{

                      public static void main(String args[]){
                         
                          int[] arr = {10, 15, 20, 25, 30};
                         
                                 System.out.println("Using for Loop");
                          for( int i=0; i<arr.length; i++ ){
                                 System.out.println("Value of arr is " + arr[i]);
                          }
                         
                                 System.out.println("\nUsing foreach Loop");
                          for(int a : arr){
                                 System.out.println("Value of arr is " + a);
                          }
                         
                          }
                  }
                  Output :

                  Using for Loop
                  Value of arr is 10
                  Value of arr is 15
                  Value of arr is 20
                  Value of arr is 25
                  Value of arr is 30

                  Using foreach Loop
                  Value of arr is 10
                  Value of arr is 15
                  Value of arr is 20
                  Value of arr is 25
                  Value of arr is 30


                  WHILE OR DO WHILE FOOPS ARE STUDY IN NEXT Post

                  loop kya hai in hindi,types of loop in foxpro,conditional statement in hindi,loop in c language notes,what is loop in javascript in hindi,java full notes in hindi,For Loops in java [hindi and english both],for loop in java in hindi,for each loop in java in hindi,while loop in java in hindi,nested loop in hindi,loop kya hai in hindi,types of loop in foxpro,conditional statement in hindi,loop in c language notes,what is loop in javascript in hindi,java full notes in hindi,For Loops in java [hindi and english both],for loop in java in hindi,for each loop in java in hindi,while loop in java in hindi,nested loop in hindi,loop kya hai in hindi,types of loop in foxpro,conditional statement in hindi,loop in c language notes,what is loop in javascript in hindi,java full notes in hindi,For Loops in java [hindi and english both],for loop in java in hindi,for each loop in java in hindi,while loop in java in hindi,nested loop in hindi,loop kya hai in hindi,types of loop in foxpro,conditional statement in hindi,loop in c language notes,what is loop in javascript in hindi,java full notes in hindi,For Loops in java [hindi and english both],for loop in java in hindi,for each loop in java in hindi,while loop in java in hindi,nested loop in hindi,loop kya hai in hindi,types of loop in foxpro,conditional statement in hindi,loop in c language notes,what is loop in javascript in hindi,java full notes in hindi,For Loops in java [hindi and english both],for loop in java in hindi,for each loop in java in hindi,while loop in java in hindi,nested loop in hindi,loop kya hai in hindi,types of loop in foxpro,conditional statement in hindi,loop in c language notes,what is loop in javascript in hindi,java full notes in hindi,For Loops in java [hindi and english both],for loop in java in hindi,for each loop in java in hindi,while loop in java in hindi,nested loop in hindi,loop kya hai in hindi,types of loop in foxpro,conditional statement in hindi,loop in c language notes,what is loop in javascript in hindi,java full notes in hindi,For Loops in java [hindi and english both],for loop in java in hindi,for each loop in java in hindi,while loop in java in hindi,nested loop in hindi,loop kya hai in hindi,types of loop in foxpro,conditional statement in hindi,loop in c language notes,what is loop in javascript in hindi,java full notes in hindi,For Loops in java [hindi and english both],for loop in java in hindi,for each loop in java in hindi,while loop in java in hindi,nested loop in hindi,loop kya hai in hindi,types of loop in foxpro,conditional statement in hindi,loop in c language notes,what is loop in javascript in hindi,java full notes in hindi,For Loops in java [hindi and english both],for loop in java in hindi,for each loop in java in hindi,while loop in java in hindi,nested loop in hindi

                  Sunday, August 5, 2018

                  9:40 AM

                  How to set Environment Variables in Java: Path and Classpath

                  How to set Environment Variables in Java: Path and Classpath


                  How to set path in java. Let's see how can we set path in java on windows and linux platform with temporary and permanent path.
                  The PATH variable gives the location of executables like javac, java etc. It is possible to run a program without specifying the PATH but you will need to give full path of executable like C:\Program Files\Java\jdk1.8.0_131\bin\javac A.java instead of simple javac A.java
                  Step 1) Right Click on the My Computer ,and Select the properties
                  Step 2) Click on advanced system settings
                  Step 3) Click on Environment Variables
                  Step 4) Click on new Button of User variables
                  Step 5) Type PATH in the Variable name.
                  Step 6) Copy the path of bin folder which is installed in JDK folder.
                  Step 7) Paste Path of bin folder in Variable value and click on OK Button.
                  Note: In case you already have a PATH variable created in your PC, edit the PATH variable to
                  PATH = <JDK installation directory>\bin;%PATH%;
                  Here, %PATH% appends the existing path variable to our new value
                  Step 8) following steps to set "CLASSPATH".
                  Note: In case you java installation does not work after installation, change classpath to
                  CLASSPATH = <JDK installation directory>\lib\tools.jar;
                  Step 9) Click on OK button
                  how to set java path in windows 10,how to set java path in windows 8;how to set java path in linux;how to check java path in windows using cmd;how to install jdk in windows 10;set path windows 10;how to install jdk in windows 7 32 bit;set path windows 7