Rishi Raj has Published 76 Articles

Instance variables in Java

Rishi Raj

Rishi Raj

Updated on 24-Feb-2020 05:08:46

24K+ Views

Instance variables are declared in a class, but outside a method, constructor or any block.When space is allocated for an object in the heap, a slot for each instance variable value is created.Instance variables are created when an object is created with the use of the keyword 'new' and destroyed ... Read More

How to extract the first n characters from a string using Java?

Rishi Raj

Rishi Raj

Updated on 20-Feb-2020 04:46:52

941 Views

To find the consonants in the given String compare every character in it using the charAt() method with the vowel letters and remaining are consonants.ExampleLive Demopublic class FindingConsonants {    public static void main(String args[]) {       String str = new String("Hi Welcome to Tutorialspoint");       for(int i=0; i

What is the difference between String s1 = "Hello" and String s1= new String("Hello") in java?

Rishi Raj

Rishi Raj

Updated on 19-Feb-2020 12:48:04

4K+ Views

When you store a String asString str1 = "Hello";directly, then JVM creates a String object with the given value in a separate block of memory known as String constant pool.And whenever we try to create another String asString str2 = "Hello";JVM verifies whether any String object with the same value ... Read More

Denormalization of dimension tables in InfoCube in SAP BW

Rishi Raj

Rishi Raj

Updated on 06-Dec-2019 06:54:17

255 Views

Note that In Data Warehouse, data load is less frequent as compared to data read. If you use normalized tables that result more number of joins and hence when you run multiple read statements on DW system, it effects the performance considerably.When you are not using normalized tables, the response ... Read More

Problem with division as output is either 0 or 1 when using ifthenelse condition in ABAP program

Rishi Raj

Rishi Raj

Updated on 05-Dec-2019 09:43:10

258 Views

The problem is that your second parameter is 0 which is an integer, so the output always comes as an integer as ifthenelse takes data type from the second parameter. So, in your case, if the answer is less than .5, it is converted to zeroes and in case more ... Read More

Finding minimum value across different columns in SAP HANA

Rishi Raj

Rishi Raj

Updated on 05-Dec-2019 09:20:19

699 Views

You need to use LEAST instead of min as below:“SELECT ID, LEAST(DAY_1, DAY_2, DAY_3) FROM ...” Please make sure that none of the values in your column in “NULL”.

Error while selecting into field-symbol in SAP ABAP

Rishi Raj

Rishi Raj

Updated on 05-Dec-2019 09:13:59

455 Views

The problem is that you have not declared Field-symbol. Try using the below code.data:  ws_bkpf      TYPE bkpf_type. SELECT MANDT    INTO CORRESPONDING FIELDS OF ws_mandt UP TO 1 ROWS    FROM bkpf    WHERE belnr = '1700001016'. ENDSELECT.

How to use JavaScript to redirect an HTML page?

Rishi Raj

Rishi Raj

Updated on 07-Oct-2019 08:08:32

2K+ Views

You might have encountered a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection.It is quite simple to do a page redirect using JavaScript on the client side. To redirect your site visitors ... Read More

How to use JavaScript to hide a DIV when the user clicks outside of it?

Rishi Raj

Rishi Raj

Updated on 18-Sep-2019 08:30:50

1K+ Views

To hide a div when the user clicks outside of it, try to run the following codeExampleLive Demo                    window.onload = function(){             var hideMe = document.getElementById('hideMe');             document.onclick = function(e){                if(e.target.id !== 'hideMe'){                   hideMe.style.display = 'none';                }             };          };             Click outside this div and hide it.    

Java ResultSet findColumn() method with example

Rishi Raj

Rishi Raj

Updated on 30-Jul-2019 22:30:26

1K+ Views

When we execute certain SQL queries (SELECT query in general) they return tabular data.The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in general).The ... Read More

Advertisements