Home
Tutorials
Core Java
Introduction To Java
Java Evolution
Overview of Java
Constants, Variables and Data Types
Java Operators
Branching Statements
Looping Statements
Classes, Objects and Methods
Inheritance
Array, String and Vectors
Java Interfaces
Java Packages
Applet Programming
Graphics Programming
Advanced Java
Java AWT
Java Event Handling
Java File Handling
Java MultiThreading
Java Swing-I
Java Swing-II
Exception Handling
Socket Programming
Java Database
Java RMI
Java Servlets
Java Beans
Programms
Projects
Downloads
Contact
Java Programming
!doctype>
The ? : Operators
import java.io.*; class Con_Operator { public static void main(String args[]) throws Exception { String i,p; System.out.print("\n\tEnter the Value :\t"); BufferedReader ob = new BufferedReader(new InputStreamReader(System.in)); p = ob.readLine(); int p1 = Integer.parseInt(p); int xx = (p1 > 0) ? p1 : - p1; System.out.print("\n\tAbsolute Value : \t "+ xx); } }
Output of "Con_Operator.java"
Read more »
Download Complete Program
-
No comments:
Post a Comment
No comments:
Post a Comment