Skip to main content

learn basic java from basic


Learn basic java from basic,learn basic java from basic, learn java from basic, understand java program from basic, pass string to java program, pass number to java program, java basic dynamic program, accept number and print using java program, accept name and display message java dynamic program, java type casting programming example 

Hi friends in this blog post i am sharing with you java basics concepts this is day two tutorial .

You must know installation and how to run java program in my previous post . click here to know more

 in assignment one we are going to print simple hello word message 

in second program we are going to pass string parameter to java program and 
in third assignment we are going to pass number parameter .

to understand you must know the basic structure of java program 

 lets understand basic structure of java program 


java program start with class name java class as shown in following program

 we use class ClassName {   }
               
(remember class name always start with Capital letter below eg ) 
in class we use to write 

 public static void main(String args[])
   
main is a starting point of java program contains parameter as array of strings i have given name args you can use as s , p , a as you wish , value contain args is string value 
as first value find in args[0], you can pass n number of values to java program 

1)Java Program to print simple message

 Save as One.java
public class One{
     public static void main(String args[])
 {
     System.out.println("good one \n ");
        System.out.println("good Morning \n");
  }
}

open cmd 
javac One.java
java One 




2)Java Program to print simple message 
accept user name (string Value) as a parameter.
 Java program to accept username dynamically and display good morning massage to that name 

 Save as Two.java

public class Two{
public static void main(String args[])
  {
  System.out.println("good morning"+args[0]);
  }
}

javac Two.java
java Two Prakash
utoput : good morning Prakash 




3)Java Program to accept number as argument and print it 

Save as Three.java

class Three{
public static void main(String args[])
{
  int a;
  int add=0;
  a=Integer.parseInt(args[0]);
System.out.println("Number entered= \t"+(a));
                    }
}

javac Three.java
java Three 10
outoput : Number entered 10




java tutorial w3schools, java tutorial for beginners ,java tutorial for beginners pdf ,advanced java tutorial java tutorial point ,java tutorial videos, java basics interview questions ,java basics concepts ,java tutorial w3schools, java tutorial for beginners, java tutorial for beginners pdf, advanced java tutorial java tutorial point, java tutorial videos ,java basics interview questions,Learn basic java from basic,learn basic java from basic, learn java from basic, understand java program from basic, pass string to java program, pass number to java program, java basic dynamic program, accept number and print using java program, accept name and display message java dynamic program, java type casting programming example 

Comments

Labels

Show more

Popular posts from this blog

Calculator Program using jFrame

Calculator Program using jFrame java swing calculator example java jframe calculator source code java code for simple calculator using gui how to make a calculator in advance java using JFrame simple calculator program in java using frame simple calculator program in java source code write a code to create simple calculator using swing component import javax.swing.*; import java.awt.event.*; public class TextFieldExample extends JFrame implements ActionListener{     JTextField tf1,tf2,tf3;     JButton b1,b2; //declaration of control     TextFieldExample(){         JFrame f= new JFrame("Button click demo"); //         tf1=new JTextField();         tf1.setBounds(50,50,150,20);         tf2=new JTextField();         tf2.setBounds(50,100,150,20);         tf3=new JTextField();       ...

Java Program to delete record using JFrame and Prepaired Statement

Java Program to delete record using JFrame and Prepaired Statement Here is table Design  Create table demo using two column as id  and Dname , id is primary key  Program source code  +import javax.swing.*;   import java.awt.event.*;   import java.sql.*; public class FrameDelete extends JFrame implements ActionListener{       JTextField tf1,tf2,tf3;       JButton b1,b2;   JLabel l1,l2; Connection con;    PreparedStatement psmt;   int result; //declaration of control    FrameDelete(){           JFrame f= new JFrame("InsertDemo");   // l1=new JLabel("Enter RollNo"); l1.setBounds(150,10,150,50);         tf1=new JTextField();           tf1.setBounds(150,50,150,20);   tf3=new JTextField();           tf3.setBounds(1...

Basic java

java java java, learn java online free, classroom java tutorial, beginners java, java beginners, java programming,  basic java , basic java Tutorial,  basic java  Assignment           Hello friends ,       I am learning Basic java . my motive behind this blog is to help those want to learn Basic java online free of cost and grab each and every basic aspect of java programming .     you can find java tutorial from basic on this blog i will post each and every assignment of basic java with source code .          we will divide our course  in to Day work .          Let's start Day One  Basic Java Assignment for  Beginners      Basic Requirement to learn Java Programming Download following software             1. Text Editor (Notepad, Notepad++, Edit pad, Eclipse...