Study Viral (Java Tutorials For Beginners - Step By Step)
  • Home
  • Java Tutorials
    • Core Java
    • Java Swing
    • MS Access JDBC Java Application
  • Facebook Page
  • Programs
    • C Programs
    • C++ Programs
    • Java Programs
    • Python Programs
  • UGC NET
  • Home
  • Java Tutorials
    • Core Java
    • Java Swing
    • MS Access JDBC Java Application
  • Facebook
  • Programs
    • C Programs
    • C++ Programs
    • Java Programs
    • Python Programs
  • UGC NET

Java Tutorial - 17 - If else Statement - Study Viral

 October 15, 2017     Java Tutorials     No comments   

Java Tutorial - 17 - If else Statement - Study Viral

Decision Making Statements (if-else)

The if-then statement is the most simple control flow statements. It helps your program to execute a certain block of code only if a particular test evaluates to true.
Type of if-else

if Statement
if else Statement
if else if Statement
Nested if - else 
===================================
class DecisionMaking{
    public static void main(String []args){
   
        if(true){
            System.out.println("Yes its true");
        }
        System.out.println("Out side if ");
   
        if(false){
            System.out.println("Yes its again true");
        System.out.println("out side if");
        }     
    }
}

==========================================

class DecisionMaking{
    public static void main(String []args){
       
        int a = 10;
        int b = 20;
        boolean bb = true;
        Boolean bool = true;
                   
        if(bool){
            System.out.println("Wow if can accept Wrapper Class object"); 
        } else if((a>b) && bb){
            System.out.println("Yes its true");
            System.out.println("Yes a > b");
        }else{
            System.out.println("Yes its else part");
        }
        System.out.println("From Outside");   
    }
} 
=================================================

class DecisionMaking{
    public static void main(String []args){
        int a = 10;
        int b = 20;
        boolean bb = true;
        Boolean bool = new Boolean(false); //Wrapper Class Object
        if(bool){
            System.out.println("Wow if can accept Wrapper Class object");
        } else if((a<b) && bb){
            System.out.println("Yes its true");
            System.out.println("Yes a > b");
        }else{
            System.out.println("Yes its else part");
        }
        System.out.println("From Outside");     
    }
}


Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

 October 08, 2017     Java Tutorials     No comments   




Java Tutorial 16 - Command Line Arguments - Study Viral 

This video show you the use of Command Line Arguments with some Wrapper Class functions like parseInt(), parseDouble(), etc.
Command Line arguments are used to pass String values to Java programs at runtime.

www.studyviral.in

info@studyviral.in


class CommandLine{
 //www.studyviral.in
 public static void main(String []studyviral){
  String a  = studyviral[0];
  String b = studyviral[1];
  
  System.out.println(a);
  System.out.println(b);
  System.out.println(a+b);
  /*int c = Integer.parseInt(a);
  int d = Integer.parseInt(b);
  System.out.println(c+d);
  */
  double c = Double.parseDouble(a);
  double d = Double.parseDouble(b);
  System.out.println(c+d);
 }
}





Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Tutorial -15 Operators - Conditional Operator - Study Viral

 October 05, 2017     Java Tutorials     No comments   



Java Tutorial -15 Operators - Conditional Operator - Study Viral

www.Studyviral.in

Conditional operator (?:) operates on three operands.

The symbol "?" placed between the first and the second operand , and " : " is inserted between the second and third operand.

Result = Expr1  ?  Expr2  :  Expr3 ;

If expr1 has value true, the operator returns a result expr2 .
If expr1 has value false, the operator returns a result expr3 . 

www.studyviral.in 

info@studyviral.in 

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Tutorial 14 - Operators - Unary Operator - Study Viral

 October 05, 2017     Java Tutorials     No comments   



 Java Tutorial 14 - Operators - Unary Operator - Study Viral

The unary operators works only on single operand. They perform various operations such as incrementing/decrementing a value by one, negating an expression, or inverting the value of a boolean.

+ Unary plus operator
- Unary minus operator
++ Increment operator
-- Decrement operator
! Logical Not operator
~ Complement operator

++var  Pre-Increment
--var Pre-Decrement
var++ Post-Increment
var-- Post-Decrement

www.StudYViraL.in
info@studyviral.in
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

Java Tutorial - 13 Operators Shift Operator - Study Viral

 October 02, 2017     Java Tutorials     No comments   


Java Tutorial - 13 Operators Shift Operator - Study Viral

The Java programming language also provides operators that perform bitwise and bit shift operations on integral type values.

       Symbol      Description
<<Left Shift Operator
>>Right
Shift Operator
>>>Right
Shift Operator (With Zero Filling)

YouTube Link :: Java Tutorial - Study Viral

For Suggestions :: info@studyviral.in

Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

12 Java Tutorial - Operators - Assignment Operator - Study Viral

 October 01, 2017     Java Tutorials     No comments   


12 Java Tutorial - Operators - Assignment Operator - Study Viral

The assignment operator (=) is the most commonly used binary operator in Java.
It evaluates the operand on the right hand side and then assigns the resulting value to a variable on the left hand side.
This video also show the use of Compound Assignment Operators like  += , -= , *=, /= , %=.

For Suggestions Email at  info@studyviral.in
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg

11 Java Tutorial - Operators - Bitwise Operators - Study Viral

 October 01, 2017     Java Tutorials     No comments   


11 Java Tutorial - Operators - Bitwise Operators - Study Viral


Bitwise Operators are used to control values of primitive data-types.

SymbolDescription
&Bitwise AND
|Bitwise Inclusive OR
^Bitwise Exclusive OR

For Suggestions Email at  info@studyviral.in 
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Newer Posts Older Posts Home

Facebook

StudyViral

Labels

Alphabet Pattern Binary Tree BLOB (Binary Large Object) Computer Networks Computer Science And Applications Paper-II Data Structure DBMS Digital Clock Digital Watch Extra Tutorials File Upload Find Age from Date of Birth Graph-Algorithms Java and J2EE web applications JAVA JDK 12 Java Mail API Java MySQL Java Programs Java Programs List Java Servlets Java Swing Java Swing With MySQL Database Java Tutorials JCalender KVS Compuer Science - January 2017 Question Paper MS Access JDBC Java Application Multiuser Login NETBEANS 11 IDE Occurrence of Digits in Number Operation System Pattern Program Reverse of String Sending Email Servlet Servlet Tutorial Software Engineering Star Struts 2 FrameWork Struts 2 Registration Form UGC NET JULY 2018 Windows Commands

Popular Posts

  • Program 01: Write a program to display/print your name.
     Program 01 - Write a program to display/print your name. This is a very basic and introductory program in Java. You might see similar p...
  • Install NetBeans 11 IDE on Windows 10 - Study Viral
    Install NetBeans 11 IDE on Windows 10 - Study Viral How to Install NetBeans 11 IDE on Windows 10. Download Link : https://netbeans...
  • Create CON, AUX, NUL name folder and files in Windows - Study Viral
    Create CON, AUX, NUL name folder and files in Windows - Study Viral Most of you may be aware of many MS-DOS commands but still n...

Categories

  • Alphabet Pattern (13)
  • Binary Tree (2)
  • BLOB (Binary Large Object) (1)
  • Computer Networks (2)
  • Computer Science And Applications Paper-II (40)
  • Data Structure (6)
  • DBMS (1)
  • Digital Clock (1)
  • Digital Watch (1)
  • Extra Tutorials (3)
  • File Upload (1)
  • Find Age from Date of Birth (1)
  • Graph-Algorithms (1)
  • Java and J2EE web applications (3)
  • JAVA JDK 12 (1)
  • Java Mail API (3)
  • Java MySQL (5)
  • Java Programs (44)
  • Java Programs List (3)
  • Java Servlets (3)
  • Java Swing (16)
  • Java Swing With MySQL Database (4)
  • Java Tutorials (37)
  • JCalender (1)
  • KVS Compuer Science - January 2017 Question Paper (6)
  • MS Access JDBC Java Application (6)
  • Multiuser Login (1)
  • NETBEANS 11 IDE (1)
  • Occurrence of Digits in Number (1)
  • Operation System (4)
  • Pattern Program (8)
  • Reverse of String (2)
  • Sending Email (1)
  • Servlet (3)
  • Servlet Tutorial (3)
  • Software Engineering (4)
  • Star (7)
  • Struts 2 FrameWork (2)
  • Struts 2 Registration Form (1)
  • UGC NET JULY 2018 (40)
  • Windows Commands (2)

Pages

  • Java Tutorials
  • ASP.NET (in Hindi)
  • Java Programs List

Blog Archive

  • ►  2021 (3)
    • ►  April 2021 (3)
  • ►  2019 (7)
    • ►  June 2019 (1)
    • ►  May 2019 (2)
    • ►  March 2019 (4)
  • ►  2018 (111)
    • ►  November 2018 (7)
    • ►  October 2018 (20)
    • ►  September 2018 (10)
    • ►  August 2018 (3)
    • ►  July 2018 (19)
    • ►  June 2018 (5)
    • ►  May 2018 (2)
    • ►  April 2018 (3)
    • ►  March 2018 (11)
    • ►  February 2018 (18)
    • ►  January 2018 (13)
  • ▼  2017 (36)
    • ►  December 2017 (10)
    • ►  November 2017 (9)
    • ▼  October 2017 (7)
      • Java Tutorial - 17 - If else Statement - Study Viral
      • Java Tutorial 16 - Command Line Arguments - S...
      • Java Tutorial -15 Operators - Conditional Operator...
      • Java Tutorial 14 - Operators - Unary Operator - St...
      • Java Tutorial - 13 Operators Shift Operator - Stud...
      • 12 Java Tutorial - Operators - Assignment Operator...
      • 11 Java Tutorial - Operators - Bitwise Operators -...
    • ►  September 2017 (10)

About Me

Rohit Basra
Hello guys my name Rohit Basra. I love to code and teach java language.
View my complete profile

Followers

Copyright © Study Viral (Java Tutorials For Beginners - Step By Step) | Powered by Blogger