31,001 Topics

Member Avatar for
Member Avatar for arvind_m

I am a Data Science Enthusiast, Currently Exploring Different Types of Programming Languages.

Member Avatar for Reverend Jim
0
26
Member Avatar for singhdevendra8

how can we use math .pi without using impot java.lang.Math*; PROGRAMING LANG:- JAVA

Member Avatar for Mule_1
0
208
Member Avatar for dimitrilc

## Introduction ## The `java.nio.file.Files` class includes many convenient methods to read file attributes, but sometimes these convenient methods just are not enough to meet our needs. In this tutorial, we will go over 5 ways to use the `Files` class to read file attributes so you can choose the …

3
204
Member Avatar for dimitrilc

## Introduction ## When working with an application with a global user base, there is usually a need to display text, numbers, currency, date, and time in multiple localized formats. For example, the **en-US** (*English-USA*) version of the date September 22, 2021 is written as 22 сентября 2021 г. when …

3
181
Member Avatar for dimitrilc

## Introduction ## Although not included in the headlines, the release of JDK 17 also added 3 sets of new methods to the class `java.lang.Process`: 1. `inputReader()` to read from stdout. 2. `inputWriter()` to write to stdin. 3. `errorReader()` to read from stderr. In this tutorial, we are going to …

3
1K
Member Avatar for Mausam_1
Member Avatar for MagnusTheRed90

I need an end user license agreement for code shared amongst my home projects with other developers. The EULA needs to include a "pay to the order of x" clause, and also needs to include the ability for me to utilze the code at multiple companies that I could participate …

Member Avatar for Dani
1
52
Member Avatar for dimitrilc

## Introduction ## In Java 8, `@Repeatable` was introduced and this is the recommended way to create repeating annotations. We still have to create a holder Annotation(*annotation that holds an array of other annotations*), but we no longer have to declare the holder Annotation at the callsite. This tutorial aims …

3
231
Member Avatar for Wis_874

import requests endPoint = 'https://api.mnotify.com/api/template' apiKey = 'YOUR_API_KEY' url = endPoint + '?key=' + apiKey response = requests.get(url) data = response.json();

Member Avatar for rproffitt
0
28
Member Avatar for 変態

I'm having trouble in my assignment Assignment :: TwoLargestElements Complete the following program so that it computes and writes out the two largest elements in the array. It always display "12" on both largest and largest2 import java.io.* ; public class TwoLargest { public static void main ( String[] args …

Member Avatar for rproffitt
0
38
Member Avatar for dimitrilc

## Introduction ## Java 15 introduced Text Blocks. The main reason behind Text Blocks is that programmers can write multiline strings without having to specify escapes for the most common scenarios. ## Goals ## At the end of this tutorial, you would have learned: 1. How to store multiline String …

Member Avatar for JamesCherrill
2
141
Member Avatar for dimitrilc

## Introduction ## Before Java 8, methods had to throw an exception or return `null`, with neither of which approaches were perfect. Optional, OptionalInt, OptionalLong, and OptionalDouble were introduced in Java 8 to represent values that might possibly be `null`. Optionals have two internal states, **empty** or **present**. An Optional …

Member Avatar for JamesCherrill
2
1K
Member Avatar for Wis_874
Member Avatar for Sagar_9

Hi All, Good Day. Is there any sample code in JAVA for generating encrypted block PIN in the similar fashion as the Hardware Security Module Regards, Sagar

Member Avatar for Sagar_9
0
92
Member Avatar for redZERO

Hi guys I can't seem to get a new line in a [CODE]JOptionPane.showMessageDialog(null, " ");[/CODE] statement. I try the /n command, but it still doesn't seem to work. Is there any way I can get a paragraph in a dialog box like this? Thanks.

Member Avatar for Samukelo
0
18K
Member Avatar for Khen Louegie

I'm supposed to make a menu with choices, the choices being different kinds of java syntax. import java.util.*; public class Start { public void menu() { System.out.println("[1] If\n[2] If else\n[3] For loop\n[4] Switch Statement\n[5] One dimension"); System.out.print("Select program: "); } public void backend() { System.out.println("[9] Menu\n[0] Quit"); Scanner q = …

Member Avatar for JamesCherrill
0
172
Member Avatar for dimitrilc

## Introduction ## There are many ways to design secure Java objects. In this tutorial, we are going to learn how to create secure Java objects by understanding **Accessibility**, **Extensibility**, and **Immutability**. ## Goals ## At the end of this tutorial, you would have learned: 1. Understand how and why …

Member Avatar for JamesCherrill
2
144
Member Avatar for Sagar_9

Hi Everyone, Is there a java code to convert SWIFT MT103 message to pacs 008 ISO20022 format? Thank you. Regards, Sagar

Member Avatar for Sagar_9
0
442
Member Avatar for dimitrilc

## Introduction ## In this tutorial, we will focus on how to manage IO permissions to read, write, and delete local files using the `SecurityManager` class. ## Goals ## At the end of this tutorial, you would have learned: 1. What policy files are and how to use them. 2. …

2
256
Member Avatar for Zirely

Hello, I need help to make this code to run please. this is just a part of the code. I have the imports below, but hsa.Console is not imported, I have tried to download de jar files for it but cannot find it. Is there a way I could make …

Member Avatar for rproffitt
0
154
Member Avatar for brodeur

// The "FriedmanRPSgame" class. import java.awt.*; import hsa.Console; public class FriedmanRPSgame { static Console c; // The output console public static void main (String[] args) { c = new Console (); // VARIABLES int rock; int paper; int scissors; // INPUT c.println (" Choose 1 for rock, 2 for paper, …

Member Avatar for Zirely
0
240
Member Avatar for katesfb

Hi, I am new to this forum and also new to android programming using Android Studio and am stuck on a coding problem so i am not sure this is the right forum but any help is much appreciated: I am trying to get some some code via the processing-core …

0
48
Member Avatar for jsrankin

Been programming more than half my life and been in industry for over a decade.

Member Avatar for Reverend Jim
0
47
Member Avatar for dimitrilc

## Introduction ## Java 14 was released with a new type of expression called Switch Expression. Its syntax is similar to that of the Switch Statement, with a few differences. In this tutorial, we will walk through concepts related to the Switch Expression and learn how to use it. ## …

3
108
Member Avatar for dimitrilc

## Introduction ## In this tutorial, we are going to learn how to create a Java module by hand. ## Goals ## At the end of this tutorial, you would have learned: 1. What a `module-info.java` file is. 2. How to compile a module. 3. Describing a module. ## Prerequisite …

2
108
Member Avatar for dimitrilc

## Introduction ## This tutorial introduces the `CyclicBarrier` class and teaches you how to use it. ## Goals ## At the end of this tutorial, you would have learned: 1. How to use `CyclicBarrier` to synchronize tasks across multiple threads. ## Prerequisite Knowledge ## 1. Intermediate Java. 2. Basic knowledge …

3
136
Member Avatar for dimitrilc

## Introduction ## `partitioningBy()` collects a `Stream` into a `Map`. In this tutorial, we will compare the two different `partitioningBy` methods and learn how to use them. ## Goals ## At the end of this tutorial, you would have learned: 1. What `Collectors.partitioningBy` does and how to use it. ## …

3
205
Member Avatar for dimitrilc

## Introduction ## Based on the 2020 Java Ecosystem survey from Jetbrains, 75% of Java developers are still using JDK 8. JDK 11 introduces `HttpClient`, which replaces the legacy `HttpURLConnection` API. For this tutorial, we will build a `HttpClient` that consumes the free Cat Facts API. ## Goals ## At …

Member Avatar for JamesCherrill
3
434
Member Avatar for mir_sheely

I am in trouble. I need to convert a signed 16-bit Hexadecimal no to short. Say I have a string s = "f2f7" Which is a negative number and lies in the range -32768 to 32767 so is the range of type short. But when I do short num ; …

Member Avatar for Andrey_7
0
1K
Member Avatar for Mohamed_167

I am attaching my complete code. I am not able to get why doesn't my KeyListener work. None of the KeyListener events are fires on pressing the keyboard. Please have a look and tell me the flaws in my code package swing; //First Class (separated class) import javax.swing.JFrame; public class …

Member Avatar for JamesCherrill
0
486

The End.