Home Tutorialhelp Comment can we write a program in this way

 
 

Comment

mangalamalatkar
can we write a program in this way,
April 25, 2007 at 4:40 PM

class greaternumber
{
public static void main(String[] args)
{
int x=100,y=200,z=12;
if (x>y && y>z)
{
System.out.println("x is the Greater number");
}
else if(z>x && z>y)
{
System.out.println ("Z is the larget number");
}
else
{
System.out.println("Y is the larger number");
}
}
}
View All Comments | View Tutorial
Related Tutorial and Articles
Design concepts & design patterns Questions

without writing web.xml file we can write servlet program
without writing web.xml file we can write servlet program  Sir Morning... Sir I have one Question "without writing web.xml file we can write servlet program". if yes which way? if no why? but without use Annotation........ Plz 

Java Beginners

how to write the program - Java Beginners
in case of any loss of data has the feature of modifying the input data we can also...how to write the program  WAP to create the report card user input Name, Class, Division, Roll no., Marks obtained in following subjects Lang Hindi 

Java Beginners

What is the best way to write to file in Java?
What is the best way to write to file in Java?  I am creating a program in Java which writes into a text file. What can be the be best method to write to a text file in Java? Since my program will continuously write the data 

Java Beginners

write program - Java Beginners
write program  write a java program that will read the values...]); } System.out.println(); } } } For more information on java visit to : http://www.roseindia.net/java/beginners/ Thanks 

Java Beginners

write a program - Java Beginners
write a program  1. write a program that reads a string composed of 6 words then generate and print a word composed of the first letters of the 6 words.  Hi friend, Code to solve the problem : class FirstLetter 

Java Beginners

Balance multi-way tree implimentation reating database - Java Beginners
a project in which I have to create a database product in java where user can... database like Access,MySQL.As we know database is based on Balance multi-way tree..so we have to implement that Balance multi-way-Tree..Simple data(integer,char 

Java Beginners

how to write this program? - Java Beginners
how to write this program?  (game:scissor,rock ,paper) A program that plays the sciccor-rock-paper game.Revise the program to let the user continuously play until either the user or the computer wins more than 4 times 

JavaScript Questions

Write a program in java...
Write a program in java...  Hi, friends Please, can you help me? Q1: Write a program in java to simulate a calculator. Your program should take two... to enter an integer number. Write a program in java to find the factorial 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program to input a string and print out the text with the uppercase and lowercase letters reversed, but all other characters... OUTPUT : wELcOMe to sCHOOL Sir, Can we show this program through 

Java Beginners

java program - Java Beginners
java program  plzzzzz help me on this java programming question? hello people.. can u plzzzzzzzzzzzzzzzzzzz help me out with this java programm. its... code for this program by the way u are not supposed to use arrays 

Java Beginners

can u plz try this program - Java Beginners
can u plz try this program  Write a small record management application for a school. Tasks will be Add Record, Edit Record, Delete Record, List.... --------------------- <%@ page language="java 

Java Interview Questions

Please write code for this program in java and Explain it ? pl'sssssssss
Please write code for this program in java and Explain it ? pl'sssssssss  Question: We are given an array of 2n integers wherein each pair... of a dinosaurs respectively. The range of valid years we want to consider is [-100000 to 2005 

Java Beginners

can some help out on wrting this program. - Java Beginners
can some help out on wrting this program.  Write a Java program... and the price of the order computed to your program. NOTE: The first number on the file 

JSP Servlet Questions

how to write a program to search a record using mvc2
how to write a program to search a record using mvc2   how can we write a code to search a record in table by using java bean as model, servlet as contoller and jsp as view 

Java Beginners

java program help - Java Beginners
....write a program to perform this job.. Sir....how can we find income tax... incometax which we have to make a program on java a company has employees who...java program help  sir i just want to clarify one statement that i am 

Java Beginners

java program - Java Beginners
. It helps us to avoid name conflicts. As you can see in the following program...://www.roseindia.net/java/beginners/MatrixMultiply.shtml Thanks...java program   Pl. let me know about the keyword 'this' with at least 

Java Beginners

write following program
-threading. Explain with examples Q2 Write a java applet that takes your name... the state transition diagram of a thread Q6 Write a java applet that displays 9... is a java applet? Write a java applet to display "Hello JAVA". Also write the relation 

Java Beginners

write a program
write a program  write a program add 2 no.s without use arithmetic,unary operaters in java 

Java Beginners

How to Write to file in Java?
How to Write to file in Java?  How to Write to file in Java Program... section so that we to write into a character-output stream. You can Visit this link... the Examples of How to write to File in Java Program: WriteToFileExample.java import 

Java Beginners

program problem - Java Beginners
program problem  Design and write a Java application that takes as input a single letter and displays the corresponding digit on the telephone. The letters and digits on a telephone are grouped this way: 2 = ABC 4 = GHI 6 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program to find the Factorial of a number using Recursion. Factorial can be defined as Factorial(n) = 1 * 2 * 3 â?¦.* (n-1) * n.  Hi Friend, Try the following code: class 

JSP Servlet Questions

can we write a method in JSP - JSP-Servlet
can we write a method in JSP  Hi All, In my web application I want to call another second jsp file. I can do it by redirecting my first jsp file... write you requirement clear then i can able to give ans. thanks rajkumar 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program that detects successive repeated occurrence of a letter in a word. For example, in the word â??explanationâ?? letter â... means in a continuous way like 'programming' in which m is a successive repeated 

Java Beginners

java program - Java Beginners
java program  "Helo man&sir can you share or gave me a java code hope its ok?" a. Write a definition of the method ONE so that it returns the sum.... b. Write the definition of method TWO as follows: I. Read a number 

Java Beginners

Java Program - Java Beginners
Java Program  Hi, I'm have complications with this program. I keep getting errors and my coding is off. Can you help me? Write a program called...: Have your program accept the user input in two text fields. When a button 

Java Beginners

Java Program - Java Beginners
Java Program  Write a Java program to create an JApplet with three Jbuttons Morning, Afternoon and Evening. When we click Morning button, the message â??Good Morning to youâ?? must appear . Similar for the other two buttons â 

Java Beginners

Java Program - Java Beginners
Java Program  Hi I'm having trouble with this program, i keep getting errors. Can you help me. Thanks Write a program to create a file named "numbers.dat". Then create an algorithm that adds all even numbered integers from 1 

Java-Tutorials

Java One way Hashing
Java One way Hashing One way hash functions are a major tool in cryptography... and authenticate the message. It can have other practical applications as well... system. Here we have used md5 algorithm for hashing. Here is the code: import 

Java Beginners

Java Program - Java Beginners
Java Program  Hi I'm having trouble with this problem, I keep getting errors. Write a program GuessGame.java that plays the game ?guess the number? as follows: Your program chooses the number to be guessed by selecting 

Java Beginners

write java code discount bookstore - Java Beginners
write java code discount bookstore  The question Cik Mat operates... with special discounts, while others are sold at normal price. Write a program which... transaction. However, the program will be better if a customer can buy and pay 

Java Beginners

java program example - Java Beginners
java program example  can we create java program without static and main?can u plzz explain with an example 

Java Beginners

Java program - Java Beginners
Java program  Dear maam/Sir, I am a 2nd year Computer programming student and we are given an assignment, a program that will show... not that familiar with java environment.. My friend told me that you can help me with my 

Java Tips and Examples

Java Write To File - Java Tutorial
of Java Tutorial you will learn how to write java program to write to a file. We... Java program. This tutorial teaches you how you can use the OutputStreamWriter on a FileOutputStream classes to write data to a file from Java program 

Java Beginners

How can i write a datagrid coding - Java Beginners
How can i write a datagrid coding  Hi, I want make a datagrid..plz send me datagrid coding using mysql database and jsp..plz tell me brief description about grid how can i connect datagrid with database. Thanks 

Java Beginners

program - Java Beginners
program  Hello..can u write the following program for me ..thanks 1. Write a program that reads three numbers and an integer n. The program... the program : import java.io.*; class NumberProgram { public static void main 

Java Beginners

program - Java Beginners
program  hi, i need a program that illustrates the concept of userdefined exceptions. can u please suggest me a way out.  Hi friend, Program to userdefined exceptions : import java.io.*; import 

Java Beginners

write a java program
write a java program  write a program to print '*' in a circular form 

Java Beginners

program for HashSet - Java Beginners
program for HashSet  I need a program that illustratest the concept of HashSet. can u please suggest me a way out.  Hi friend, A set...://www.roseindia.net/java/example/java/util/ Thanks. Amardeep 

Java Beginners

program for Hashmaps - Java Beginners
program for Hashmaps  I need a program that illustrates the concept of HashMaps.please can you suggest me a way out.  Hi, A HashSet.... http://www.roseindia.net/java/example/java/util/ Thanks. Amardeep 

Java Beginners

really need help on how to write this program plz some 1 help out. - Java Beginners
really need help on how to write this program plz some 1 help out.  i am confused here on what to write can some 1 help out here i dont quite understand how to code it so can some 1 help out. Part II Write, compile and execute 

Java Beginners

program code - Java Beginners
program code  Design and write a Java application that takes as input a single letter and displays the corresponding digit on the telephone. The letters and digits on a telephone are grouped this way: 2 = ABC 4 = GHI 6 

Java Beginners

How to write Java Program
How to write Java Program  how to write a program to find average of 5 student marks 

Java Beginners

How to write to xml file in Java?
How to write to xml file in Java?  Hi Friends, Can anyone help me how to write in xml file in Java programming. Please fill free to give example... in java program we need to use the package javax.xml. This javax.xml package 

Java Beginners

program - Java Beginners
program  sir..can u tell me wat to do in this program.... i do not know what to do,,,,,, write a program to enter date ( date,month, and year) and check the validity for date , month, and leap year......  Hi 

Java Beginners

Write a java program that prints out the following menu???
Write a java program that prints out the following menu???  Write a java program that prints out the following menu. Auser can interact with the menu using numbers (1,2,3,4,5,6). The menu will be printed again if the user enters 

Java Interview Questions

Write a java application program........?
Write a java application program........?  Welcome every One : I have Q in Java? Q : Write a java application program that reads 20 integer numbers input by the user and prints how many numbers > 100 and how many numbers 

General

Example to compile a java file with the help of the program
are describing you the way to compile the java file with the help of the java program. The steps involved for compiling the java file from the program are described... Example to compile a java file with the help of the program 

Java Beginners

WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  Write program which accepts five students id,name,age,department,courses, taken and its grade. a. calculate its GPA . display all student information in ascending order 

Java Beginners

How can I write a GUI stack program by Java to push Image files instead of other data type items?
How can I write a GUI stack program by Java to push Image files instead of other data type items?   How can I write a GUI stack program by Java to push Image files instead of other data type items? for the push instruction I 

Java Beginners

Java Program HELP - Java Beginners
Java Program HELP  Hi I'm having trouble with this program, i keep getting errors. Can you help me. Thanks Write a program to create a file named "numbers.dat". Then create an algorithm that adds all even numbered integers 

Java-Tutorials

Java Write to File
Java Write to File In this tutorial you will learn how to write to file in java. Write to a file in java we are required to use some classes of java.io... doing the basic process to execute a java program write simply on command 

Java Beginners

Java Program Complication error - Java Beginners
Java Program Complication error  Hi there, I have this program I had to write called ThreeArrayLists.java, but I keep getting this error "use... and then I'll display the code. Write a program called ThreeArrayLists.java that declares 

Java Beginners

Making efficient program - Java Beginners
Making efficient program  Hi, How you can write efficient programs in Java? Thanks 

Java Tips and Examples

A program which converts feet and inches to centimeters.
Java: Exercise - InchesToCm Write a program which converts feet and inches to centimeters. In this application we will write code for converting feet... in any special way (ie, you can use the default number to string conversion 

Java Beginners

Java Program HELP - Java Beginners
Java Program HELP  Hi I'm having trouble with this problem, I keep getting errors. Write a program GuessGame.java that plays the game ?guess the number? as follows: Your program chooses the number to be guessed by selecting 

Java Beginners

WRITE A PROGRAM IN JAVA
WRITE A PROGRAM IN JAVA  How do I write a program in Java, have the program display a message with your name in it and a number (Hello john Smith!1) The number must increment from zero to nine, or decrement fron nine to zero. You 

Java Beginners

help needed for a program - Java Beginners
help needed for a program   i am having trouble understanding on what to code, so can some 1 help me out here. thanks in advance. Part I Write, compile and execute a Java program that displays the following prompts 

Programming Tutorials

We can run Java on most platforms provided a platform must has a Java interpreter
; We can run Java on most platforms provided a platform must has a Java... translates the Java bytecode into the code that can be understood by the Operating... the source code into the Java bytecode, the same way the Java interpreter translates 

General

Using image in WML We can use the
this lesson we will write application that images. We can use..., in that case we can use the alt property of <img>... is the code of the program 

Java Beginners

write a program in java.
write a program in java.  arrange the natural n umber in 5x5 matrix as 21 22 23 24 25 20 7 8 9 10 19 6 1 2 11 18 5 4 3 12 17 16 15 14 13 i at centerd position and remaining arrange in anticlockwise direction.   

Java Beginners

Java Program - Java Beginners
Java Program  Write a java program to find out the sum of n-number of digits of a given number by the user 

Java Beginners

JAVA program - Java Beginners
JAVA program  Write a JAVA program to accept a number and find whether it is a magic number 

Java Beginners

JAVA program - Java Beginners
JAVA program  Write a JAVA program to accept a number and find whether it is a magic number 

Java Beginners

a java program - Java Beginners
a java program  well sir, i just wanna ask you something regarding that if the question say .....write a program to check whether a number is even... for more information. http://www.roseindia.net/java/beginners/PrimeNumber.shtml 

Java Beginners

How to write in File in Java
to write in File of Java Program...How to write in File in Java  Hi, How to write in File in Java... the (BufferedReader) constructor. So that we write some data suing 

Java Beginners

Java Program - Java Beginners
Java Program  how will write Java programs using if-else, if-else-if & switch case. give five questions & answers in each.  Hi Friend...://www.roseindia.net/java/beginners/index.shtml Thanks 

Java Beginners

program for chat - Java Beginners
program for chat  please provide code for fallowing 1)Write a java program Multi-user chat server and client 

Java Beginners

Best way to reading file in java
Best way to reading file in java  Hi, As a beginner I want to learn about Java programming and make a program for reading a text file in java. What is the best way for reading file in Java? Thanks 

Java Beginners

how to write this program
how to write this program  Write a program in java which calculates... or numerical grade. You will be submitting TWO versions of this program. Write one...?˘s GPA. This program should take a studentââ?¬â?˘s First Name, Last Name a GPA 

Java Beginners

c program - Java Beginners
c program  Write a program to encrypt a string and decrypt 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program to store and read the data of a student(s) in & from a file named ?STUD.DAT?. The student?s data consists of name... integers). The program should have the option for inserting new data, updating 

Java Beginners

Java Program - Java Beginners
Java Program  Hi I have this program I cant figure out. Write a program called DayGui.java that creates a GUI having the following properties... Mnemonic B Add individual event handlers to the your program so that when 

Java Beginners

Java Program - Java Beginners
Java Program  Write a java program to find out the sum of a given number by the user?  Hi Friend, Try the following code: import java.util.*; public class UserInput{ public static void main(String[]args 

Java Beginners

Java Program - Java Beginners
Java Program  Write a java program to find out the sum of digits of a given number by the user?  Hi Friend, Try the following code: import java.util.*; public class SumOfDigits { public static void main 

Java Beginners

a java program... - Java Beginners
a java program...  write a program to check that a number is Armstrong or not. An armstrong is one which is same as the sum of the cube of the digits of the number. write a program to print the following pattern 55555 54444 

Java Beginners

object oriented program.. - Java Beginners
object oriented program..  Write a class called RaceCar.java that contains instance variables horsepower, weight, zeroTo60, and milesPerGal.../horsepower/0.7 where horsepower can range from 200 to 700 hp, and weight can range from 

Java Beginners

Object oriented program - Java Beginners
Object oriented program  Write a class called RaceCar.java that contains instance variables horsepower, weight, zeroTo60, and milesPerGal. The value.../horsepower/0.7 where horsepower can range from 200 to 700 hp, and weight can range from 

Java Beginners

java program - Java Beginners
java program  write a program that asks the user for a starting value and an ending value and then writes all the integers (inclusive) between those two value.  Hi Friend, Try the following code: import java.util. 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program that demonstrates the use of multithreading with the use of three counters with three threads defined for each. Three threads should represent the counters as follows : 1) One counter starts from 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program to print the following output using the for loop. 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5  Hi Friend, Try the following code: class pyramid{ public static void main(String[] args){ int i 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program that demonstrates the use of multithreading with the use of three counters with three threads defined for each. Three threads should represent the counters as follows : 1) One counter starts from 

Java Beginners

One way hash in Java - Java Beginners
One way hash in Java  Hi, What is one way hashing. How to implement it in Java. I've to compare the contents of two files by generating their hash value in Java. Please give some examples. Thank You,  Hi Friend 

Java Beginners

please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  Q 1) In a class first day 25 students are joined. After two days that total students will increased to 60. We can develop a program by using ArrayList concept 

Java Beginners

Java Program - Java Beginners
Java Program  Define an exception called â??NoMatchExceptionâ?? that is thrown when a string is not equal to â??Symbiosisâ??. Write a Java program that uses this exception.  Hi Friend, Try the following code 

Java Beginners

java program - Java Beginners
Java programing environment   From where i can download the Java programming environment 

Java Beginners

details of my program - Java Beginners
) days maybe we can give up from using array of oblect and make it as a usual array but it could make the program much longer note: i want to use the method... from the registered list and give him the cost of his orders 2- we do the same 

Java Beginners

java program - Java Beginners
java program   Use antlr to write a program Grep for searching the input for a word: java Grep word [filename] The program reports the line number...:\Program Files\Java\jdk1.5.0_04\ antlr-3.0.1\jas\grep>java Grep fish tryin.txt 

Java Magazine Questions

Program
Program  hey please help me ... How can write multiple choice...... can any body help for me.using servlet,html   Here is a jsp test... is then calculated. For this application, we have created a table test 

Java Beginners

Java Program - Java Beginners
Java Program  My friend has a java project. He wanted to have java program that has 4 menu options which are (1)Add Data(from the user:last name.....can anyone help me so I can give ideas to him?    can you explain 

Swing AWT

Write a program to design a page.use radio button?
Write a program to design a page.use radio button?  i would lik to know about well designed page   In the given code, we have used swing...(); } public SwingFrame(){ JFrame f = new JFrame("Frame in Java Swing 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program to compute sum of digits of a given number. (Hint: Separate digits one by one from the number and then add)  Hi Friend, Try the following code: import java.util.*; public class 

Java Beginners

Java Program - Java Beginners
Java Program  Write a program that prints prime numbers between 1 to n. Number n should be acepted as command line input.  Hi Friend, Try the following code: import java.util.*; class PrimeNumbers{ public 

Java Beginners

Java Program - Java Beginners
Java Program  Write a Java program that calculates and prints the simple interest using the formula : Simple Interest = PNR / 100 Input values P,N,R should be accepted as command line input as below. e.g. java SimpleInterest 5 

Java Beginners

java program - Java Beginners
java program  write a program in java to print the following pattern? 1 2 3 4 3 4 5 4 3 4 5 6 7 6 5 4 5 6 7 8 6 5 4 3  Hi Friend, Try the following code: class ShowPattern{ public static void main(String 

Java Beginners

java Program - Java Beginners
java Program  1. Write a java program to accept 10 numbers in an array and compute the sum of the square of these number. 2. Wrtie a java program that reads in three strings from the command line arguement and arrange them 

Java Beginners

java program - Java Beginners
java program  1.Write a program in java to input a sentence and find out how many palindromes are there in the sentence. 2. Write a program in java to input a sentence and find out total number of blank spaces and words.   

Java Beginners

java Program - Java Beginners
java Program  1. write a program which accept a string from a keyboard and counts number of characters in it. 2 display the following pattern 1 1 2 1 2 3 1 2 3 1 2 3 4 pls send answ as soon as possible  Hi 

Java-Tutorials

Java Write To File From String
Java Write To File From String In this tutorial you will learn how to write to file from string. Write to file from string using java at first we will have... to execute a java program write simply on command prompt as : javac 

Java Beginners

Java Program - Java Beginners
Java Program  Hi i have this program I can't figure it out. Write a program called InheritanceTest.java to support an inheritance hierarchy... classes. Write a program that instantiates objects of your classes, test all instance 

Java Beginners

i am confused here on what to write can some 1 help out here - Java Beginners
i am confused here on what to write can some 1 help out here  i don't quite understand how to code it so can some one help out 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.