Java programming Basics



Java is one of in trend languages and most widely used computer programming language. It became one of the core languages for developing applications. The dynamical approach of java language catches the attention of programmers. Java programmers are earning a handsome salary for their development in this very trendy object-oriented language.


Basics of Programming Language
To begin with, Java, first of all, install famous java development environments such as NetBeans and Eclipse for both these environments. JDK (java development kit) is required as a prerequisite.


Java reserved Words:
Every language has a bunch of reserved words which the programmer cannot use while developing his program. Reserved word or keywords for java are following


https://3.bp.blogspot.com/-TH7E7hnlSRk/WYa2KrQoqYI/AAAAAAAAAU4/4tKzkyNQBIc4qBtX1pTCIThMHP2BPR65gCLcBGAs/s400/reserved%2Bwordds.PNG


Basic input/output:
To cope with Java object-oriented nature our next step is to a create class. Remember the name of file and java class will be the same one else it will create an error. After a class has been created, within curly braces of the main function write a simple line of code “System.out.println(“”); this statement is used for the output.


https://3.bp.blogspot.com/-1Jm7ty0hqb0/WYa31mp0QLI/AAAAAAAAAVI/8BvgZ7gUsEoPvUIPgj208YEFiChqv3-LACEwYBhgL/s400/pic%2B1.PNG
Class is declared public for accessing it from outside. and inheriting purpose. The main() function is declared static because static functions are called without any object that’s why main is declared as static.


Void keyword is used when we do not return any parameter same as main() function is not returning any parameters. Main () function is mandatory for executing the program as without Main () JVM (java virtual machine) will not execute program.



Input in java is a bit complicated because we have to add packages for  Scanner class and can be done by following steps.Add scanner class by importing it's package "import java.util.Scanner;". Declare object for scanner class "Scanner input=new Scanner(System.in);" (input is object of scanner class while new is a keyword of java used for creating object of scanner class.  Declare variables. (int number1=0; );
  • https://3.bp.blogspot.com/-x8hRhe-UfWU/WYa3jbUVSQI/AAAAAAAAAVE/Kdlx_rEzjJkCU9hB8LyBL1_ooyVysMUQgCEwYBhgL/s400/output.PNG
    Prompt user to enter input by output statement. Assign variables the inputted values by this statement (number1=input.nextInt();). execute program.
  •  Having a rich set of predefined classes are the Strength of java language. Scanner class is also a predefined class in java. Pre-defined classes are grouped in java packages. Import keyword helps the compiler to include these packages. The format specifier %d is used for an int value (in this case the value of sum) and the %n is used for newline and “printf” is format specifier function.


                                        
 Watch this video for more info

Are you the one upset about your keywords so here is the solution Kwfinder
 

Post a Comment

2 Comments

Thanks for the wonderful share. Your article has proved your hard work and experience you have got in this field. Brilliant. I love it reading. Java Application Development Company