Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners how to generate random questions
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ebuka
how to generate random questions
1 Answer(s)      5 years and 9 months ago
Posted in : Java Beginners



Advertisement
View Answers

April 2, 2009 at 4:06 PM


Hi friend,

Plz specify the technology with full details like Java,JSP,Servlet,ASP and .net etc...

See the below code in Java to help in solving the problem :

import java.util.*;
class RandomQuestion
{
public static void main(String[] args)
{
String[] questionAr=new String[5];
questionAr[0]="Question No 1";
questionAr[1]="Question No 2";
questionAr[2]="Question No 3";
questionAr[3]="Question No 4";
questionAr[4]="Question No 5";
Random generator = new Random();
int r = generator.nextInt(questionAr.length);
System.out.println(questionAr[r]);
}
}


Thanks


Related Tutorials/Questions & Answers:
how to generate random questions - Java Beginners
how to generate random questions  i am designing a test engine, i want my questions to be generated randomly. how can i do this?   Hi..."; Random generator = new Random(); int r = generator.nextInt(questionAr.length
How do I generate random number?
How do I generate random number?  In my Java program there is a requirement of generating random numbers between two given numbers. How do I write..., The java.util.Random class can be used to generate the random numbers. Check the tutorial
Advertisements
How to generate random number in java
How to generate random number in java In this section you will learn how to generate random number in java. Java API  provide a random class in java.util.Random package which generate random number within a range. The random
Generate Random Numbers
Generate Random Numbers  hi,,, Please give me answer with example How do you generate random numbers within a given limit with actionscript... This function generate random numbers with in given limit
Generate array of random numbers without repetition
Generate array of random numbers without repetition In the previous section, you have learnt how to generate an array of random numbers from the given array... created an application that will generate the array of random numbers without
Generate random numbers in Java
Generate random numbers in Java - How to use the java.util.Random class to generate desired random number in Java program? In this tutorial I will teach you how to write Java code using the java.util.Random class to generate single
generate random numbers and display the largest
generate random numbers and display the largest  Hi, I am using... creates an array and fills it with random ints, prints the contents... ArrayRandom{ public static void main(String args[]){ Random r = new Random
Generate random numbers from 1 to 100
Generate random numbers from 1 to 100  1)A class Called: RandomNumberGenerator that generate random numbers from 1 to 100 2)A class Test that tests... an object from the Random NumberGenerator class to generate your input test data
Default constructor generate two random equations
Default constructor generate two random equations  Need to create a default constructor in a programmer defined class that generates a random question, addition or subtraction. And when adding the numbers must be random from 0-12
Generating Random Number
for your application. Random Number is the frequently used to generate numbers... how to create a random number and example provided here will help you easily understand and use the code to generate random numbers in your java application
Generate array of random numbers
Generate array of random numbers You can generate a random number either by using the Random class or by using the static method Math.random() but it is better to use Random class. If you want to generate a series of random numbers
how to show random image in ASP.net?
how to show random image in ASP.net?  hello bros i saw in many websites..there is a programming of random image changing.... i want to use this in my ASP.NET websites, can any one suggest me code or any kind of help..so that i
Generate shuffling in the specified list
list1 = Arrays.asList(employee); // create object of Random class to generate number randomly. Random num = new Random(); // shuffle and print the list according to the generated random number
how to generate auto code ?
how to generate auto code ?  i wanna genrate auto code for id in core java. pls tell me code of auto genrate
J2ME Random Number
J2ME Random Number       In this application we are going to generate the random number using Random class. The Random class within the java.util package and we can use
how to generate bank account number?
how to generate bank account number?  how to generate account number?or format or rules for bank account number
generate graf report.. - JSP-Interview Questions
generate graf report..  How to generate report(graf) using jsp code
How to generate XML from XSD?
How to generate XML from XSD?  Hi Experts, I have a xsd with me. I want to generate XML files based on the XSD with fields filled out from the database tables. Please Help me out
how to generate code - Java Beginners
how to generate code   hi friends, this is poornima i want to generate code about online shopping by using servlets,jsp,html,jdbc and eclipse (IDE) could you please tell me about what are steps included. Thanks in advance
how to generate timetable - JSP-Servlet
how to generate timetable  can i have a jsp/servlet code for generating timetable for examinations for university like courses btech,cse ece etc... By giving starting date and ending date it will automatically generate
how to generate pdf file in struts
how to generate pdf file in struts  I am developing a struts application.I am having one registration form when i am submitting the form the values are stored in database,the database name is registration. In another form i am
how to generate pdf file in struts
how to generate pdf file in struts  I am developing a struts application.I am having one registration form when i am submitting the form the values are stored in database,the database name is registration. In another form i am
How to generate build.xml file
How to generate build.xml file       This example shows how to generate the build.xml file. You may say that build.xml file is the backbone of ANT (Another Neat Tool
how to select random rows from database through servlet
how to select random rows from database through servlet  hello i want to know, how to select random rows from database through servlet
random number
random number   Please How do I generate a program that gives me random integer from 115 to 250? Using java.util.random. Thank you very much!  ...[] args){ int min = 115; int max = 250; Random random = new Random
How to Generate Reports in Java - Java Beginners
How to Generate Reports in Java  How to Display and Generate Reports in Java? Give Me Full Sample Code  Hi Friend, What do you want to display on reports.Please elaborate it. Thanks
how to generate the pdf report from jsp
how to generate the pdf report from jsp  <%@page import="com.itextpdf.text.,com.itextpdf.text.pdf.,java.io.*;"%> </head> <... want to generate the pdf file from jsp page.I add the itext.jar to the libraries
How to generate xml file using xpath
How to generate xml file using xpath  Hi, I have a requirement in whixh I have x path of all the nodes with its corresponding values and I need to make a xml using that,. It would be great is you can help me out with how
how to generate captcha in jsp page ? - JSP-Servlet
how to generate captcha in jsp page ?  hi friends, i would like to implement Captcha in login screen. i'm unsing struts. could you please give some sample codes to implement this. Thank you Ganesh  Hi, This link
random numbers
random numbers  hi.. i am creating a website and on feedback form to authenticate user i want to generate a random number on label.if user types that number correctly in textbox then he is allowed to submit feedback otherwise
Generate area for map from backing bean - Java Server Faces Questions
Generate area for map from backing bean  I need to populate the map in my page, and the coordinates should come from the backing bean.. How could I do
Advertisements
 

 

 

DMCA.com