Java Articles

Page 450 of 450

What are number format exceptions in Java?

Sai Subramanyam
Sai Subramanyam
Updated on 30-Jul-2019 255 Views

This Exception happens once you associated convert a string variable in an incorrect format to a whole number (numeric format) that's not compatible with one another. Example public class Test { public static void main(String[] args) { int data = Integer.parseInt("hello"); } } Output Exception in thread "main" java.lang.NumberFormatException: For input string: "hello" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at a6.dateAndTime.Test.main(Test.java:5)

Read More

What is the difference between System.out, System.in and System.err streams in Java?

Swarali Sree
Swarali Sree
Updated on 30-Jul-2019 2K+ Views

All the programming languages provide support for standard I/O where the user's program can take input from a keyboard and then produce an output on the computer screen. Similarly, Java provides the following three standard streams:Standard Input: This is used to feed the data to user's program and usually a keyboard is used as a standard input stream and represented as System.in.Standard Output: This is used to output the data produced by the user's program and usually a computer screen is used for standard output stream and represented as System.out.Standard Error: This is used to output the error data produced ...

Read More

How can dead thread be restarted in Java?

Sai Subramanyam
Sai Subramanyam
Updated on 30-Jul-2019 2K+ Views

A thread goes through various stages in its lifecycle. For example, a thread is born, started, runs, and then dies. New − 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. Runnable − After a newly born thread is started, the thread becomes runnable. A thread in this state is considered to be executing its task. Waiting − Sometimes, a thread transitions to the waiting state while the thread waits for another thread to perform a task. ...

Read More

What is the Thread class in Java?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jul-2019 481 Views

The java.lang.Thread class is a thread of execution in a program. The Java Virtual Machine allows an application to have multiple threads of execution running concurrently. Following are the important points about Thread −Every thread has a priority. Threads with higher priority are executed in preference to threads with lower priority.Each thread may or may not also be marked as a daemon.There are two ways to create a new thread of execution.One is to declare a class to be a subclass of Thread.Another way to create a thread is to declare a class that implements the Runnable interface.

Read More

Using custom calculation views in SAP Cloud IoT

John SAP
John SAP
Updated on 30-Jul-2019 257 Views

To add a logic to show maximum value it hardly matters if you are using trial version or licensed version. Try using database views to add this logic simply.You can refer this link to know more technical capabilities of SAP Cloud IoT: https://help.sap.com/docs/SAP_IoTSAP offers a comprehensive portfolio of solutions for the Internet of Things (IoT). This in-memory IoT platform can help you quickly develop, deploy, and manage your own real-time IoT and machine-to-machine (M2M) applications. Use the platform to automate processes at the core and connect to almost anything at the edge of your network.

Read More

Can constructors be inherited in Java?

Monica Mona
Monica Mona
Updated on 30-Jul-2019 4K+ Views

No, constructors cannot be inherited in Java. In inheritance sub class inherits the members of a super class except constructors. In other words, constructors cannot be inherited in Java therefore, there is no need to write final before constructors. Example public interface InterfaceTest { public InterfaceTest(){ } public abstract void display(); public abstract void show(); } Still, if you try to write constructors in an interface it will generate a compile time error. Error C:\Sample>javac InterfaceTest.java InterfaceTest.java:2: error: expected InterfaceTest(){ ^ 1 error C:\Sample>

Read More
Showing 4491–4496 of 4,496 articles
« Prev 1 446 447 448 449 450 Next »
Advertisements