Java Basic Programs

List of Operators in Java​ Arithmetic OperatorsAddition +Subtraction –Multiplication *Division /Remainder(Module) %Relational OperatorsLogical OperatorsBitwise OperatorsAssignment OperatorsTernary or Conditional Operators Adition operator :- Result is :12 Subtraction in Java package seleniumtool.com; public class Subtraction { } Result=10 Multiplication in Java package seleniumtool.com; public class Multiplication { } Result=6 Division in java package seleniumtool.com; public class Division … Read more

Java Variables

Variables are containers for storing data values. In Java, there are different types of variables, for example: 1) String – stores text, such as “Hello Techlearn“. String values are surrounded by Double Quotes.2) int – stores integers (whole numbers), without decimals, such as 12345 or -123453) float – stores floating point numbers, with decimals, such as 18.55 or -18.554) char – stores single characters, such as ‘a’ or ‘B‘. Char values are surrounded by Single Quotes5) boolean – … Read more

Naming convention in java with example

SNo. Name Convention Example 1. package name should be start with in lowercase letter  java, lang, sql, util etc 2. class name should start with uppercase letter and be a noun  String, System, Firefox, DataInput, Thread  3. interface name should start with uppercase letter and be an adjective Runnable, Remote, ActionListener 4. method name should be start with in lowercase letter, then from … Read more

Java Programs

Program to print alphabets:- package SeleniumLearn.com; public class PrintAlphabets{    public static void main(String[] args){                for(char i=’A’; i<=’Z’; i++){            System.out.print(i+” “);        }        }}  O/P:- A B C D E F G H I J K L M N O … Read more