Visualizzazione dei risultati da 1 a 9 su 9

Discussione: java

  1. #1

    java

    a che servono le istruzioni INUSER e INTERN???
    - Ma7u -
    Sysadmin.it
    Forum Moderator

  2. #2
    Di quale classe ???

  3. #3
    Utente bannato
    Registrato dal
    Sep 2001
    Messaggi
    413
    sono metodi di una qualche tua classe?

  4. #4
    spero ti sia d'aiuto!


    import java.applet.Applet;
    import java.applet.AppletContext;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.io.*;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.EventObject;

    public class PasswdLevel4 extends Applet
    implements ActionListener
    {

    public PasswdLevel4()
    {
    inuser = new String[22];
    totno = 0;
    countConn = null;
    countData = null;
    inURL = null;
    txtlogin = new TextField();
    label1 = new Label();
    label2 = new Label();
    label3 = new Label();
    txtpass = new TextField();
    lblstatus = new Label();
    ButOk = new Button();
    ButReset = new Button();
    lbltitle = new Label();
    }

    void ButOk_ActionPerformed(ActionEvent actionevent)
    {
    boolean flag = false;
    for(int i = 1; i <= totno / 2; i++)
    if(txtlogin.getText().trim().toUpperCase().intern( ) != inuser[2 * (i - 1) + 2].trim().toUpperCase().intern() && txtpass.getText().trim().toUpperCase().intern() !
    - Ma7u -
    Sysadmin.it
    Forum Moderator

  5. #5
    Se è per caso il livello 4 di Try2Hack.. devi andare più in basso a leggere.. quando scoprirai la password vedrai che ti mangerai le mani, ce l'hai lì a portata di mano !
    Se non è quello che penso.. sorry !

  6. #6
    Utente bannato
    Registrato dal
    Sep 2001
    Messaggi
    413
    allora:

    inuser è un'0array di stringhe che ti crei tu.

    intern() è un metodo della classe String,

    da documentazione :

    intern
    public native String intern()
    Returns a canonical representation for the string object.
    A pool of strings, initially empty, is maintained privately by the class String.

    When the intern method is invoked, if the pool already contains a string equal to this String object as determined by the equals method, then the string from the pool is returned. Otherwise, this String object is added to the pool and a reference to this String object is returned.

    It follows that for any two strings s and t, s.intern() == t.intern() is true if and only if s.equals(t) is true.

    All literal strings and string-valued constant expressions are interned. String literals are defined in §3.10.5 of the Java Language Specification


    Returns:
    a string that has the same contents as this string, but is guaranteed to be from a pool of unique strings.




  7. #7
    si èprorpio quello!!!

    ora spero di trovarla...
    ma è in chiaro nel codice?
    - Ma7u -
    Sysadmin.it
    Forum Moderator

  8. #8
    trovata!!! thx
    - Ma7u -
    Sysadmin.it
    Forum Moderator

  9. #9
    Ok.. visto che alla fine era lì ?? :-)
    Divertiti col 5 !!!
    Ciao !

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.