Alankritha Ammu has Published 47 Articles

How to set CLASSPATH variable for JDK?

Alankritha Ammu

Alankritha Ammu

Updated on 13-Jun-2020 12:40:13

523 Views

Assuming you have stored your Java programs in c:\myprograms\ directory −Right-click on 'My Computer' and select 'Properties'.Click the 'Environment variables' button under the 'Advanced' tab.Now, add the 'CLASSPath' variable and set the path to the c:\myprograms\'.

What happens in Java Program at compile time?

Alankritha Ammu

Alankritha Ammu

Updated on 13-Jun-2020 12:24:56

251 Views

During compile time, java compiler (javac) takes the source file .java file and convert it to bytecode .class file.

What is the role of Keyboard Event shiftKey Property in JavaScript?

Alankritha Ammu

Alankritha Ammu

Updated on 23-May-2020 10:08:04

82 Views

The altkey property is used to show whether SHIFT key is pressed or not when key event was triggered.ExampleYou can try to run the following code to learn how to implement shiftKey property in JavaScript.                 Press any key     ... Read More

What is JavaScript Bitwise OR (|) Operator?

Alankritha Ammu

Alankritha Ammu

Updated on 20-May-2020 09:35:39

117 Views

If one of the bits are 1, then 1 is returned when Bitwise OR (|) operator is used.ExampleYou can try to run the following code to learn how to work with JavaScript Bitwise OR Operator.                    document.write("Bitwise OR Operator");          // 7 = 00000000000000000000000000000111          // 1 = 00000000000000000000000000000001          document.write(7 | 1);          

How to check if a String contains another String in a case insensitive manner in Java?

Alankritha Ammu

Alankritha Ammu

Updated on 26-Feb-2020 09:59:12

944 Views

One way to do it to convert both strings to lower or upper case using toLowerCase() or toUpperCase() methods and test.ExampleLive Demopublic class Sample {    public static void main(String args[]){       String str = "Hello how are you welcome to Tutorialspoint";       String test = ... Read More

How to test if a string contains specific words in Java?

Alankritha Ammu

Alankritha Ammu

Updated on 26-Feb-2020 09:56:55

2K+ Views

The java.lang.String.contains() method returns true if and only if this string contains the specified sequence of char values.ExampleLive Demopublic class Sample {    public static void main(String args[]){       String str = "Hello how are you welcome to tutorialspoint";       String test = "tutorialspoint";     ... Read More

Write a java program to tOGGLE each word in string?

Alankritha Ammu

Alankritha Ammu

Updated on 26-Feb-2020 07:07:50

614 Views

You can change the cases of the letters of a word using toUpperCase() and toLowerCase() methods.Split each word in the string using the split() method, change the first letter of each word to lower case and remaining letters to upper case.ExampleLive Demopublic class Sample{    public static void main(String args[]){   ... Read More

Difference between == and equals() method in Java.

Alankritha Ammu

Alankritha Ammu

Updated on 26-Feb-2020 06:42:24

2K+ Views

The equals() method compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object.Example Live Demopublic class Sample {    public static void main(String []args) {   ... Read More

String Concatenation by concat() method.

Alankritha Ammu

Alankritha Ammu

Updated on 26-Feb-2020 05:57:18

133 Views

You can concatenate two strings using the concat() method of the String class. This class concatenates the specified string to the end of this string.ExampleLive Demopublic class Test {    public static void main(String args[]){       String str1 = "Krishna";       String str2 = "Kasyap";       System.out.println(str1.concat(str2));    } }OutputkrishnaKasyap

Concatenation of Strings in Java

Alankritha Ammu

Alankritha Ammu

Updated on 26-Feb-2020 05:14:28

102 Views

You can finish your task by combining/ concatenating your two stings using concat() method or + operator.Exampleimport java.util.Scanner; public class ConncatSample {    public static void main(String []args) {       Scanner sc = new Scanner(System.in);       System.out.println("Enter your first name");       String firstName = ... Read More

Advertisements