- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Karthikeya Boyini has Published 2383 Articles
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
728 Views
The #define is preprocessor directives. So when we define some macro using #define, it replaces into the code with its value before compilation. So when the compiler does not know anything about the code, in that time also the macro values are replaced.The constant is actually a variable. By declaring ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
796 Views
Tooltip is visible whenever you will place the mouse cursor on the label. Use the setToolTipText() method to add tooltip to JLabel −label.setToolTipText("This is a demo tooltip");The following is an example to add tooltip to JLabel −Exampleimport java.awt.Color; import java.awt.Font; import javax.swing.*; import javax.swing.border.Border; public class SwingDemo { public ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
2K+ Views
Let’s say the following is String array, which we have converted to List −Arrays.asList("DE", "GH", "JK", "MN", "PQ", "RS", "TU", "VW", "XY", "BC")Now filter String stream and map to lower case −.stream() .filter(a-> a.startsWith("V")) .map(String::toLowerCase)To sort now, use the sorted() and display using forEach().The following is an example to filter ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
6K+ Views
In C or C++, we have used the switch-case statement. In the switch statement we pass some value, and using different cases, we can check the value. Here we will see that we can use ranges in the case statement.The syntax of using range in Case is like below −case ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
156 Views
To Map IntStream to String object, use mapToObj and within that set the values −.mapToObj(val -> "z" + val)Before that, we used range() on IntStream −IntStream.range(1, 10)The following is an example to map IntStream to String object in Java −Exampleimport java.util.stream.IntStream; public class Demo { public static void main(String[] ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
4K+ Views
In some applications, we have seen that some functions are declared inside another function. This is sometimes known as nested function, but actually this is not the nested function. This is called the lexical scoping. Lexical scoping is not valid in C because the compiler is unable to reach correct ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
409 Views
Let’s say the following is our String List −List list = new ArrayList(); list.add("ABC"); list.add("CDE"); list.add("GHI"); list.add("MNO"); list.add("GWE"); list.add("WDF"); list.add("JYH"); list.add("TYU");Map String List to lowercase −list .stream() .map(String::toLowerCase)After that, perform sorting −sorted((val1, val2) -> val2.compareTo(val1))The following is an example to Map string list to lowercase and sort −Exampleimport java.util.ArrayList; import ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
93 Views
For the current day, you can use CURDATE() method. Let us first create a table −mysql> create table DemoTable -> ( -> DueDate date -> ); Query OK, 0 rows affected (1.35 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-06-14' ); ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
300 Views
Following is the syntax executing the plus (+) operator −update yourTableName set yourColumnName3=(yourColumnName1+yourColumnName2)The above syntax is only for plus operator. You need to change symbol like -, *, / for other operations. Let us first create a table −mysql> create table DemoTable -> ( -> Number1 int, ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
karthikeya Boyini
7K+ Views
With Java Swing, you can set JLabel size as preferred size different than the default −JLabel label.setPreferredSize(new Dimension(250, 100));The following is an example to change JLabel size −Exampleimport java.awt.Color; import java.awt.Dimension; import java.awt.Font; import javax.swing.*; import javax.swing.border.Border; public class SwingDemo { public static void main(String args[]) { ... Read More