File Class in Java

[ad_1] File Class in Java The File class is Java’s representation of a file or directory path name. Because file and directory names have different formats on different platforms, a simple string is not adequate to name them. The File class contains several methods for working with the path name, deleting and renaming files, creating new […]

Read More

Apache Spark RDD

[ad_1] Actions Transformation: RDD can be transformed from one form to another form. Map, filter, combineByKey etc. are transformation operation which create other RDD. If you have multiple operations to be performed on the same data, you can store that data explicitly in the memory by calling cache() or persist() functions. Actions: Actions returns final […]

Read More

java.lang.Character class – methods

[ad_1] lang.Character methods java.lang.Character class – methods | Set 1 Following methods of Character class are discussed here : toUpperCase() : java.lang.toUpperCase(char arg) method converts given character in argument to its Upper case based on Unicode values. Syntax : public static char toUpperCase(char arg) Parameters : arg : character to be converted to Upper case […]

Read More

java.math class and its methods | Set 1

[ad_1] Math class provides mathematical functions to preform basic numeric operations such as exponential, logarithm, square root, and trigonometric functions. cosh, sin, tan, abs, bitLength, multiply and many more. Implementations of the functions of Math class do not return bit-for-bit same results. Hence, perform better implementations. Class Declaration public final class Math extends Object This […]

Read More

WebDriver – First test script by launching Firefox

[ad_1] Hiya everyone! Time to grab a cup of Java, I mean coffee 😉 Without further ado, let’s get started with our first test script in WebDriver. Under the same project that we created from our previous post (where WebDriver JAR files are added), I have created a new package named, ‘com.blog.tests’. Next, right click […]

Read More

String vs StringBuilder vs StringBuffer

[ad_1] Strings are immutable objects which means once String object is created, it can never be change. Whenever there is some change in String’s value. A new object of String is created in heap.String str=”hello”; String str=new String(“hello”); StringBuffers are mutable objects.StringBuffer are continuous sequence of characters. StringBuffers are Thread Safe. StringBuffer str=new StringBuffer(“zulqarnain”); StringBuilders […]

Read More

Generics in Java

[ad_1] Generics introduced in J2SE 5.0. Generics introduced for Collections. Collection store Objects and any type of object can be store in collection. When a stored object pulled back from collection it required to cast that object. Compiler does not check the type at compile time. Type Cast can be failed at runtime.Generics allow particular(Unique […]

Read More

util.date class methods in Java with Examples

[ad_1] .toString() : java.util.Date.tostring() method is a java.util.Date class method.It displays the Current date and time. Here Date object is converted to a string and represented as: day mon dd hh:mm:ss zz yyyy day : day of the week mon : month dd : day of the month hh : hour mm : minute ss […]

Read More

Linear Search in Java

What is Linear Search? Linear search or sequential search is a method for finding a particular value in a list that checks each element in sequence until the desired element is found or the list is exhausted. Its worst case cost is proportional to the number of elements in the list. Its expected cost is […]

Read More