Alankritha Ammu has Published 47 Articles

How to remove the last character from a string in Java?

Alankritha Ammu

Alankritha Ammu

Updated on 26-Feb-2020 05:07:49

2K+ Views

The StringBuffer class contains a method known as deleteCharAt(). This method deletes the character at a specified index/position. You can use this method to delete/remove a particular character from a string in Java.Examplepublic class Test {    public static void main(String args[]){       String str = "hi welcome to ... Read More

Why is NullPointerException in Java?

Alankritha Ammu

Alankritha Ammu

Updated on 25-Feb-2020 05:02:26

235 Views

NullPointerException is a runtime exception and it is thrown when the application try to use an object reference which has a null value.For example, using a method on a null reference.Object ref = null; ref.toString(); // this will throw a NullPointerException

Java Memory Model

Alankritha Ammu

Alankritha Ammu

Updated on 24-Feb-2020 09:21:54

2K+ Views

Java memory model is divided between Thread Stacks (One for each thread) and a heap area.Thread Stack: It is a thread specific memory area and contains local variables, methods call information etc. JVM stacks could be of fixed size or variable size. If computation in a thread exceeds its stack ... Read More

Converting date type SYDATUM in a format like MM/DD/YY in SAP ABAP

Alankritha Ammu

Alankritha Ammu

Updated on 13-Feb-2020 10:53:43

4K+ Views

It depends if you want to write it to a list screen or you want to convert it to a text variable. To write it to a list screen, you can use below code −WRITE I_my_dateMM/DD/YYYYTo convert it to a text variable, you can use below command −WRITE l_my_dateTO l_my_text ... Read More

What is the difference Between C and C++?

Alankritha Ammu

Alankritha Ammu

Updated on 10-Feb-2020 11:19:15

830 Views

Following are some of the differences between C and C++.When compared to C++, C is a subset of C++. All valid C programs are valid C++ programs.C is a structural or procedural programming language, while C++ is an object oriented programming language.In C, Functions are the fundamental building blocks, while ... Read More

How can we use MySQL TRIM() to remove the whitespaces from all the rows and update table?

Alankritha Ammu

Alankritha Ammu

Updated on 06-Feb-2020 06:48:17

185 Views

Suppose if a table has many values having whitespaces in the columns of a table then it is wastage of space. We can use TRIM() function to remove whitespaces from all the rows and update the table too in a single query. Following the example from ‘Employee’, having whitespaces in ... Read More

How LIKE operator works with comparison operators for matching specific kinds of patterns of a string?

Alankritha Ammu

Alankritha Ammu

Updated on 06-Feb-2020 06:00:33

67 Views

We can also use comparison operators in WHERE clause along with LIKE operator to get specific output. It is demonstrated in the following example −ExampleSuppose we want to get the names end with letter ‘v’ from a table but we do not want a specific name say ‘Gaurav’ in the ... Read More

How can we fetch all the records from a particular MySQL table?

Alankritha Ammu

Alankritha Ammu

Updated on 29-Jan-2020 06:37:09

194 Views

We can fetch all the record from a MySQL table by using SELECT * from table_name; query. An example is as follows, fetched all the records from ‘Employee’ table −mysql> Select * from Employee; +------+--------+ | Id   | Name   | +------+--------+ | 100  | Ram    | | 200  | Gaurav | | 300  | Mohan  | +------+--------+ 3 rows in set (0.00 sec)

How should I display MySQL database that is currently in use?

Alankritha Ammu

Alankritha Ammu

Updated on 28-Jan-2020 10:38:56

66 Views

We can display the name of MySQL database that is currently in use by Select Database() command.mysql> select database(); +------------+ | database() | +------------+ | tutorial   | +------------+ 1 row in set (0.00 sec)This command shows that we currently use tutorial database.

What is the JavaScript version of sleep()?

Alankritha Ammu

Alankritha Ammu

Updated on 07-Jan-2020 09:35:37

331 Views

The JavaScript version of sleep() is “await”. The await feature pauses the current aync function.ExampleYou can try to run the following code to implement sleep in JavaScriptLive Demo                    function setSleep(ms) {             return new ... Read More

Advertisements