How to count unique elements in the array using java?

Ankitha Reddy
Updated on 30-Jul-2019 22:30:20

1K+ Views

The interface Set does not allow duplicate elements, therefore, create a set object and try to add each element to it using the add() method in case of repetition of elements this method returns false − If you try to add all the elements of the array to a Set, it accepts only unique elements − Example import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class CountingUniqueElements { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter the size ... Read More

Why the main method has to be in a java class?

usharani
Updated on 30-Jul-2019 22:30:20

483 Views

Main method is the entry point of the execution in Java. When we execute a class JVM searches for the main method and execute the contents of it line by line. If you observe the following example you can compile a this program but if you try to execute it you will get an error saying “Main method not found”. Example abstract class SuperTest { public abstract void sample(); public abstract void demo(); } public class Example extends SuperTest{ public void sample(){ System.out.println("sample method ... Read More

When a thread is created and started, what is its initial state?

Samual Sam
Updated on 30-Jul-2019 22:30:20

623 Views

When a new thread begins its life cycle in the new state. It remains in this state until the program starts the thread. It is also referred to as a born thread.After this newly born thread is started, the thread becomes runnable. A thread in this state is considered to be executing its task.

What is Agentry Toolkit in SAP Mobile Platform SMP 3.0 SDK? How do you use it in an application?

Monica Mona
Updated on 30-Jul-2019 22:30:20

249 Views

Agentry toolkit provides various SDK’s to integrate with the various mobile component. With Agentry toolkit, you have a plugin to Eclipse that allows you to create modify Agentry applications.To know more about Agentry toolkit, you can refer the below SAP link:https://help.sap.com/doc/f1944845cb7b4cb886ebfbd5fa720c64/3.0.14/en-US/7c03a69470061014a336f33ca4dd4413.html

Error while using enter "!" on selection screen in SAP.

Samual Sam
Updated on 30-Jul-2019 22:30:20

253 Views

Note that “!” this character removes all characters in the field before data is transported. So you get error message cos of this.

Explain the difference between getColumnHeaders(), getColumnNames() and getColumnTitles() in SAP?

Sai Subramanyam
Updated on 30-Jul-2019 22:30:20

361 Views

getColumnHeaders() − This function is used to return all the columns which are theoretically available. getColumnNames() − This function is used to return a list of columns displayed in a tree getColumnTitles() − This function returns same number of columns as returned by getColumnHeaders()

Difference between the use of Type, Types and TYPE POOL in SAP ABAP programming.

Sai Subramanyam
Updated on 30-Jul-2019 22:30:20

1K+ Views

TYPE keyword is used for Data or FIELD Symbol declaration You use TYPES keyword for defining local types TYPE POOL is used for grouping local types so that you can use them without duplication TYPES: BEGIN OF z_t000, Name TYPE c Length 10. N_id TYPE i. TYPES END OF z_t000. One of the common examples of TYPE POOL is Type Group ABAP. Navigate to Transaction SE11 and select Type Group and type ABAP there then press F7. You will see the body of the type group which is defined by the keyword TYPE-POOL.

How to check a String for palindrome using arrays in java?

Ankitha Reddy
Updated on 30-Jul-2019 22:30:20

9K+ Views

To verify whether the given string is a palindrome (using arrays) Convert the given string into a character array using the toCharArray() method. Make a copy of this array. Reverse the array. Compare the original array and the reversed array. in case of match given string is a palindrome. Example import java.util.Arrays; import java.util.Scanner; public class Palindrome { public static void main(String args[]) { System.out.println("Enter a string "); Scanner sc = new Scanner(System.in); String s ... Read More

Refreshing list viewer data selectively in SAP ABAP

SAP ABAP Expert
Updated on 30-Jul-2019 22:30:20

211 Views

Only refreshing the selected or the modified rows is compatible or supported in EDIT mode but not in the display mode.As you said, you are using the display mode so I doubt you can do anything. But in case you switch over to EDIT mode from DISPLAY mode, then you can go for and bind the function with the DATA_CHANGED event.You can use the suggested approach and it should work for you. Hope it helps.

How to write on selection screen after giving any user input in SAP ABAP

SAP ABAP Expert
Updated on 30-Jul-2019 22:30:20

1K+ Views

You can use the WRITE to write on the selection screen. But still you have other options available to accomplish your task.You can choose to show your text in a message which is shown at the bottom of the screen. Also, you can try with a popup to show your required text.Sample snippet: Message 'Your text' TYPE S

Advertisements