Ctrl+shift+\ forward àcommit multiple line

Ctrl+shift+    / àbackward  2ur commit multiple lines

String2multiple char    ex:-mahesh

Char àsingle char        ex:-m

2java is an object oriented programming language it contains multiple data types like int,double,float,char,string

String:-It is class  data type where it is responsible to store multiple char class. we can declare the string(object) in two ways. I,e 1)locally


1) locally:-If we declare a object locally then the scope of the object in limited to that block only

Syntax:-                  string str;  \\declaration

Str”rajesh”;\\assigning value

String str1=”Mahesh”;

Methods ( or) functions:- Block of statements are known as method and it is acceptable for one action.

2Methods are runable

2we can call the method any were from the class .it means we can call the method within the method also.

2method should have a unique name

2we can declare the methods is two forwards

1)static           2)non-static

At TekSlate, we offer resources that help you in learning various IT courses. We avail both written material and demo 

video tutorials. To gain in-depth knowledge and be on par with  practical experience,

then explore Selenium Training videos.

Syntax:-          public static void methodname(){

}       \\static

Public void methodname1(){

}                                          \\non-static

2) Globally:- we can declare the objects [datatypes,methods&instances]

Globally by using access modifiers like public,private&protected.

  1. a) Public:-these can be access with in the class as well as outside of the class [out side means another class]
  2. b) Private:-these can be access with in the class only
  3. c) Protected:-these objects can be access only in child class

Syntax:-   private string str ;// global declaration

public string str1;

protected string str2;

Parameterization:-   parameter means a value[datatype].

We can pass parameter to the method in runtype[while execution]

Check out the top Selenium Interview Questions now!

Syntax: - public void sample*(string s){



Public static void main (string [] args) {

//to do auto generated method

Javabasics j=new javabasics(); //object or instance

j.sample 4(“rajesh”);

j.sample 4(“Mahesh”);


  1. Write a program to test the login functionally of by using methods?

Selene’s:- The selenium commands offer called as selenese

For an Indepth knowledge on Selenium, click on below