2. Write a program in java to find a largest number out of two numbers?

class Largest {                 public static void main(String args[])                 {                                 int a=7,b=9;                                 if(a>b)                                                 System.out.println(a+" Is Greater Than "+b);                                 else                                                 System.out.println(b+" Is Greater Than "+a);                 } }

Advertisements

Java environment: –

Java environment: - Java environment includes a large number of development tools and 100 of classes and methods. The development tools are part of the system known as java development kit or JDK and the classes and methods are part of the java standard library and is also known as the application programming interface or... Continue Reading →

1. Write a program in java to calculate and print sum of two integer number?

class Sample {                 public static void main(String args[])                 {                                 int a=5;                                 int b=10;                                 int c;                                 c=a+b;                                 System.out.print("Sum = "+c);                 } }

Introduction to java: –

Introduction to java: - Java is a general purpose, object oriented programming language developed by Sun Microsystems of USA in 1991. Originally called OAK by JAMES GOSLING, one of the inventors of the language, java was designed for the development of software for consumer electronic devices like TVs, VCRs, Toaster and such other electronic machine.... Continue Reading →

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: