Java Training Videos

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Java Training Videos

Anirban
two questions
this is regarding the third video
1.we use a class variable called browser which is assigned a value "Firefox"
what is the use of a class variable?
2.the main method is written as
public static void main (final Stirng[] args)
why do we use the keyword final?
Reply | Threaded
Open this post in threaded view
|

Re: Java Training Videos

softwaretestingforum
Administrator
Class variable is associated with class and you don't need to instantiate class to be able to access it.

for the main class, final variable may seem excessive here but its goal is to make sure that variable value can not changes once assigned. You could read more about final variable here -

http://programmers.stackexchange.com/questions/115690/why-declare-final-variables-inside-methods
~ seleniumtests.com