34 Posted Topics
Re: use an array and do bubble sort..like this [code=JAVA] for(i=0;i<totalnumbers-1;i++) { for(j=i+1;j<totalnumbers;j++) { if(array[i]>array[j] { temp=array[i]; array[i]=array[j]; array[j]=temp; } } } [/code] print array[i] | |
Re: ok. I have solved your "0" problem [code=JAVA] class newbie { public static void main(String args[]) { int i,j; for(i=0;i<6;i++) { for(j=0;j<i;j++) { System.out.print(0); } System.out.println(); } } } [/code] Now let me see how much u have tried before i give u the solution | |
A silly question I have by mistake deleted the label control in the toolbox..how do i get it back | |
Hello, I have created a master page in asp.net. I have three pages default.aspx,default2.aspx,default3.aspx which follow the master page. I have a content holder in the master page which holds a bulleted list with display mode as link button showing image on particular bullet click. But the image is shown … | |
Hello, I downloaded a theme from wordpress. I got a zip file containing all php pages. How do i ues them and create a blog of my own i hope i get a good response thanks | |
Hello, I downloaded a theme from wordpress and uploaded it to my domain server i keep getting this error Fatal error: Call to undefined function get_header() in /home/changeis/public_html/index.php on line 1 please guide | |
Hello. I am using Easy php i am trying to connect with the following code [code] <?php $con = mysql_connect("localhost","admin",""); if (!$con) { die('Could not connect: ' . mysql_error()); } // some code ?> [/code] getting error as follows Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'admin'@'localhost' (using password: NO) … | |
Re: i have tried this with combo box..hope it helps [code] Imports System.Windows.Forms public class GetComboBoxText public Shared Sub Main Application.Run(New Form1) End Sub End class Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click Dim Language As String Language = ComboBox1.Text If … | |
I wish to create an application using swing to update data to the database. I will need three buttons add, modify and delete. i have so far created JDBC connection with Ms acess. i have also created a textfield where i will enter data like this... [code=JAVA] import java.awt.*; import … | |
i am trying to learn servlets so i downloaded tomcat server.I learned that i have to do this...set path=c:\tomcat\lib\servlet.jar or click the exe file tomcat6 in the bin folder. I tried to connect with localhost8080 it is not working.I am not getting Tomcat home page. Any help will be great. | |
i am trying to help a friend on a program on client side scripting using javascript. i have the following code but i am not getting the output desired. [code] <html> <head> <Script language="JavaScript"> var usernameVal; if(document.f1.usernameVal.value.length<3) { alert("username is invalid") return false; } else { alert("acceptable") } </script> </head> … | |
Re: the use is like this [code=JAVA] if ((a % num2 ==0)&&(a%num1==0)) [/code] | |
Re: Check out this Math.pow(8,1.0/3.0) does not give value 2. use like this Math.pow(8,1.0/3). sorry it gives i am working on it..... | |
Re: If u say append_test_data is a String array i dont find an index append_test_data[index] while comparing? | |
Re: check this out [code=JAVA] class searche { public static void main(String args[]) { String s1="tangerine"; int d=s1.length(); int result=0; for(int i=0;i<d;i++) { if(s1.charAt(i)=='e') { result=1; System.out.println("position of e is at "+i); } else result=-1; } System.out.println("result= "+result); } } [/code] | |
I am trying to design the game Bulls and Cows we have a word to guess eg:"fame"(four lettered) if i type abcd bulls=0 cows=0 efgh bulls=0 cows=1 (if the letter is at the same positon as the word we give bulls. If the letter is in the word but not … | |
Re: i find (as far as i saw) u need a change after a comma(,).We will read the file character by character .When we encounter a comma we will go back and print the word..'word',n..something like this | |
Re: Here is how i can explain loop within a loop(nested loop) [code] for(int i=0;i<4;i++) { for(int j=0;j<4;j++) { ...... } } [/code] when i=0 j goes from 0 to 3// both working as counters when i=1 j again goes from 0 to 3 . . when i=3 j will go … | |
Re: i think u will need a Jframe for the dialog box , a button and an action listener. U have ignored event handling functions [code=JAVA] frame = new JFrame("Show Message Dialog"); JButton button = new JButton("Click Me"); [/code] Use actionPerformed method of the ActionListener interface I think u should first … | |
| |
i tried the following code but not getting the desired output. I need to extend Applet class along with dialog class.how do i do that? [code=JAVA] import java.awt.*; import java.awt.event.*; import java.applet.*; /*<applet code="YesNoDialog" width=400 height=400></applet>*/ public class YesNoDialog extends Dialog implements ActionListener { private Button yes=new Button("Yes"); private Button … | |
i have subject advanced java programming in my syllabus i will be learning socket programming servelets, corba,AMI,java beans etc. I have heard about apachetomcat server.How do i get the required software from net.thanks | |
i have a code with me [code] import java.applet.*; import java.awt.*; /*<applet code="DialogTester" width=400 height=400></applet>*/ public class DialogTester extends Applet { public void init() { Container container=this.getParent();//this ;why not create object of the class and call the function while(!(container instanceof Frame)) { container=container.getParent(); } Frame parent=(Frame)container; Dialog myDialog=new Dialog(parent,false); myDialog.setLocation(320,240); … | |
i wish to add another column using code in JDBC.I have one column columnname i wish to add a text type(data type in access) column in the access file my code is [code] import java.sql.*; public class Test3 { public static void main(String[] args) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); /* the … | |
i have to print 1 3 2 4 5 i the input output should be 1 3 2 4 5 4 5 6 9 9 11 15 20 26 i am getting a weird output my code is [code] import java.io.*; class nik1234 { public static void main(String args[])throws IOException … | |
i am not getting the desired output(the contents in a text file which i have saved in the jdk bin here is my code i got. Also what is return in the try catch block i wanna know. it says file not found [code] import java.io.*; class FileDemo { public … | |
i wish to print sll the combinations of digits of a number eg 123 gives 321 132 231 132.... [code] class numbers { public static void main(String args[]) { int num=123; int x=num%10; int y=num/10; int z=100*x+y; System.out.println(z); } } [/code] this is all my brain is letting me to … | |
[code] i want a program which asks the user to type the password. If he goes wrong three times exit.this is my code import java.io.*; class password1 { public static void main(String args[])throws Exception { String pass="samarth"; boolean flag=false; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String [] password=new String[20]; int i; for(i=0;i<3;i++) … | |
[code] i read that a method that is is using throws clause must be mentioned in the try and catch block.So when we use "throws IOException" in the following program why dont we use try and catch import java.io.*; class testthrows { public static void main(String args[]) //throws IOException { … | |
[code] not clear with the basics of nullpont error; trying to create student database import java.io.*; class student1 { String name; int id; public void getdata(String name1,int id1) { name=name1; id=id1; } public void putdata() { System.out.println("\t"+id+" "+name); } } class student { public static void main(String args[])throws IOException { … | |
i am getting run time error as provided in title my code is [code] class maxstring { public static void main(String args[]) { String s1="nikhil is a good boy"; int d;int x=0; d=s1.length(); String[] s2=new String[d]; char ch; for(int i=0;i<=d-1;i++) { ch=s1.charAt(i); if(ch==' ') { s2[x]=s1.substring(x,i-1); x=i+1; } } String … | |
i wish to print something like this ******** r ******* er ter uter puter mputer omputer computer where * is a blank space for each line i used array of strings String []s1=new String [20] for 5 blank spaces i used s1+" " + " "..+(5)"" then 4 blank spaces … | |
i was trying to explain a friend about interface i have followed the abstract concept but dont know to how to demonstrate [code] inteface a { void meth(int i){ }; } class dani implements a { public static void main(String args[]) {int i; public void meth(5); System.out.print(i); } }[/code] if … | |
i know how to find palindrome and also how to find reverse of string using for loop. but i wish to do it within a loop (for) using flag. can u please tell me how to use flag in c . my code is as follows [code] #include<stdio.h> #include<conio.h> #include<string.h> … |
The End.