32,199 Topics
| |
package my_package; my_object obj_instance; String my_string; my_string = obj_instance.toString(); System.out.println(my_string) ; // gives my_package.my_object@asj128 // I've lost track of obj_instance but it in memory // and I want to recover it from my_string , like my_object obj_instance1 obj_instance1 = ( my_object) my_string ; some thing like string to object converstion … | |
help me plz i need to sort ip address, am try to sort in java.util.Arrays.sort() but it not correct for eg [CODE] String st[]={"10.4.23.16","10.4.23.9"}; java.util.Arrays.sort(st); for(int i=0;i<st.length;i++){ System.out.println(st[i]); } [/CODE] the out put is 10.4.23.16 10.4.23.9 plz give idea | |
Hi First of all let me tell you that my programming skill aren't great and I'm still learning java. Basically I'm trying to write a program that allow the user to enter a quantity in textfield1. Then when the confirm button is pressed, it'll display the result in textfield2 int … | |
I have write a program to read 6 numbers and find the average of all odd numbers. here is my code Scanner get = new Scanner (System.in); double average = 0, counter = 0 ; int i, num = 0, sum = 0, count = 0, total = 0; for(i=0; … | |
I am very confuse about find the if the file is in english word. Let say that file contain some garbage letter and number but in that garbage letter and number it have a mean. Let say hello there in that file how do I set the code so that … | |
Although layout managers usually scale text properly, with the spread of "retina" Macs with screen resolutions over 200 d.p.i. we can't just keep ignoring pixel size for grahics or animation. Toolbox has a method for getting the screen resolution, but I don't have access to enough varied machines to see … | |
I want to make new string to show under the first ("Verificiranje na akauntot !") text but i dont know what to do in the "jLabel3MouseClicked" class, please help me how do i paint the graphic after i press the label ? here is some code: @Override public void paint(final … | |
package Assignment2; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; public class AuctionDialog extends JFrame implements ActionListener { private JLabel lblOutput; private JTextField tfBidder; private JTextField tfPainting; private JTextField tfAmount; private JTextArea taOutput; private JButton btnSubmit; private Painting paintings; private Bid bids; private Auction artworkAuction; public AuctionDialog( ) { artworkAuction … | |
Write a class named Car that has the following fields: yearModel. The yearModel field is an int that holds the car's year model make. The make field references a String object that holds the make of the car speed. The speed field is an int that holds the car's current … | |
Hi Dw. I want to write the program for VeriFone device that will read the cards, this device has 2 types of readers the one reads the chip and the other is for magnetic strip reader so I want to write a program that will listen for both readers and … | |
Hi,, I have a json file and I would like to convert it into java class. The main aim is to create a dynamic interface from the JSON file. I found metawidget library which can generate interface from a java class. I would like to know or possibly a sample … | |
package mobile; import java.util.*; /** * * @author user */ public class Mobile { /** * @param args the command line arguments */ public static void main(String[] args) { int[][] data = new int[10][10]; data = timesTable(10,10); Scanner scan = new Scanner(System.in); System.out.print("Enter Row:"); int row2 = scan.nextInt(); System.out.println(""); System.out.print("Enter … | |
Hi guys, I am pretty new here and with android development. I have created my first app and am looking to expand on it and add some more style to it. What I am trying to do is add a navigation drawer to the app. So instead of the buttons … | |
I'm having trouble making an eclipse plugin. This is what I have done so far, this create a menu item in project explorer (when right clicked) but it is disabled and I don't know why, maybe because the button doesn't do anything right now: <plugin> <extension point="org.eclipse.ui.menus"> <menuContribution locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?after=additions"> <command … | |
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; class Test{ public static void main(String args[]){ String Str = new String("WelcometoTutorialspoint.com-"); int i=0; System.out.println("Return Value :" ); for (String retval: Str.split("-", 2)){ System.out.println(retval); System.out.println(i); i++; } i=0; System.out.println(""); System.out.println("Return Value :" ); for (String … | |
Hello, I have a string which consists of tokens enclosed in square brackets []. I need to identify these and process the string to replace them with some other derived values. I am unable to get list of tokens via Pattern matching. Below is my code snippet. String str = … | |
Well basically, I was coding earlier and I encountered this for(int i = 0; i<acl.size();i++){ //System.out.println(acl.get(i)); if(acl.get(i).contains(role)){ permissions = acl.get(i).split(":"); if(permissions[operation].equals("yes")) return true; } } and I was getting index out of boundary exception, but I knew that wasn't the case so I decided to use a for loop to … | |
hi everyone i have 1 question regarding array in c# application how i arrange numbers in ascending or descending order in array using c# software i do this int array=new int[1,2,3,4,5] furhter i cant processed plz can anyone tell me about this thankx.. | |
hey,I have been working on a program, or at least trying to get started, but i am having some difficulty. On step 5 i am unsure on weather i would need to use a for loop of a if statement. and how would i do this. Step 6 : is … | |
Hi all Please find the telegram android application's source code https://github.com/DrKLO/Telegram/ This is a working android application, and I want to use this application as a messenger in my web application, so with this same set of code can I be able to create a web application. Thanks Varun Krishna. … | |
I am needing to write a program for someone that needs it to count by any number they manually enter into the program. I have the menu code written and now just need help with the counnting code. I know i most likely need to use a "for" loop but … | |
Hi everyone,I am assigned with an task of writing an java code to create an Word-Frequency-Counter which needs to satisfy the following constraints: 1)It must prompt the user to enter an path from where the code will read all the contents of text files(.txt) present in that directory. 2)An property … | |
Hi guys, I'm almost finished my assignment. It's purpose is to translate english words to pirate language. For example, when some enters "hello", "ahoy" is returned. But when I enter two words like "pardon me", "null" is returned even though I have assigned "avast" to it. I'm thinking this is … | |
I'm trying to make a program that reads in numbers and commands and prints the list of numbers. I am trying to solve one problem at a time and this is about exception handling. I am still not familiar with the whole exception handling that is why I get confused. … | |
Does C++ consider \/ as an escape character? And does Java consider it? I am talking about forward and backslashes. Please tell. How does Java and C++ considers them differently? I mean : in C++: this '/' works fine without escape. in Java: this '\/' will result in '/'. Is … | |
I worked for 20 years in hardware and twenty odd now in software, so change is an old friend. I consult on UNIX/LINUX to a variety of industries, write lots of bits for my own needs, love to help others over their hurdles. | |
Using Java is it possible to upgrade LG U900 version to accomodated some common applications like whatsup? Can its RAM be upgraded? Thanks guys | |
Invalid escape sequence in ^[SFTG]\d{7}[A-Z]$ Pattern .compile("^[SFTG]\d{7}[A-Z]$"); | |
write a program that will display all the odd numbers between 1 and 15. here is the code that i used Scanner scan = new Scanner (System.in); int i, num=0, count_odd = 0; for(i=1; i<=15; i++) { System.out.println("please enter number "); num = scan.nextInt(); } if(num%2!=0) { count_odd++; } System.out.println("The … | |
Hi how do I remove [] in my arraylist my sample output is [[3, 6, 5, 1, 2, 8, 50, 6, 1, 3, 1, 54, 1, 3, 1]] I just want 3, 6, 5, 1, 2, 8, 50, 6, 1, 3, 1, 54, 1, 3, 1 |
The End.