Simple Import Static Question

Hi,
Just wondering is it possible in regards to "import static" to statically import a static class or does it only allow one to import static functions and variables within a class?
Cheers.

Hi,
Thanks for your reply. I actually do understand that using "static import" will import static methods and variables. My Question is
can one import static classes themselves because I have read conflicting reports:
(1) Report 1: can statically import classes, methods and variables.
(2) Report 2: can statically import methods and variables.
e.g.
package com.edu;
public class staticImport
     static class staticImportExample
             static int i = 12;
}Can I statically import the above class as for example "com.edu.staticImport.*"? Will this import the static class "staticImportExample". I'm asking because I'm trying to figure out whether static classes can be imported.
Thanks.

Similar Messages

  • Import static then location can't be resolved

    In the following code:
    import static net.mindview.util.*;the word "net" is underlined with this message: The import net cannot be resolved.
    The actual location of the class I want to import is C:\java\TIJ4\code\net\mindview\util\*
    My class path looks like this: C:\java\TIJ4\code
    I have tried to run javac on the .java files in the util folder but it reported errors. So I just ran javac on Print.java because its the one I want to import and it reported these errors:
    Print.java:22: <identifier> expected
      printf<String format, Object... args> {
                                   ^
    Print.java:25: <identifier> expected
    } ///:~
    ^
    2 errorsSo my question is what should I do about all this to import Print?
    Thanks for any help

    Glady
    //: net/mindview/util/Print.java
    // Print methods that can be used without
    // qualifiers, using Java SE5 static imports:
    package net.mindview.util;
    import java.io.*;
    public class Print {
      // Print with a newline:
      public static void print(Object obj) {
        System.out.println(obj);
      // Print a newline by itself:
      public static void print() {
        System.out.println();
      // Print with no line break:
      public static void printnb(Object obj) {
        System.out.print(obj);
      // The new Java SE5 printf() (from C):
      public static PrintStream
      printf(String format, Object... args) {
        return System.out.printf(format, args);
    } ///:~

  • How should i do for using "import static" in CDC?

    Hello-
    First of all, i have no good Eng. skill.
    please understand me if i write wrong words.
    I'm a beginner of Java ME and i want to compile some sources using CDC Java(TM) ME platform SDK 3.0.
    The sources are using "*import static*" and they need to be compiled with 1.5 javac-source version.
    So that, i changed some properties of 'project.properties' and 'build-impl.xml' files in project folder.
    ( javac.source=1.3 --> javac.source=5
    javac-target=1.3 --> javac-target=1.5)
    after then, it didn't come out any problem when compiling but,
    'cvm.exe' error msg box came out and it could't run.
    --- Error ---
    Failed to connect to device 1!
    Reason:
    Emulator 1 failed to register in time!
    Result: 1
    cdc-run:
    profiler.check:
    open-profiler:
    run:
    BUILD SUCCESSFUL (total time: 56 seconds)
    i think the above way i did might be a forced thing.
    what should i do for this problem?
    Please let me know..
    Thanks,
    Ji hye
    Edited by: kjh10101 on Mar 29, 2010 7:28 PM
    Edited by: kjh10101 on Mar 29, 2010 7:28 PM

    From the linked document:
    For tab bar icons, create an icon in the following sizes:
    For iPhone and iPod touch:
    About 30 x 30 pixels
    About 60 x 60 pixels (high resolution)
    For iPad:About 30 x 30 pixels
    Note: The icon you provide for toolbars, navigation bars, and tab bars is used as a mask to create the icon you see in your application. It is not necessary to create a full-color icon.
    Use Preview, GraphicConverter, etc....see the Mac App Store for image editors and add an alpha channel to your image...size it, and add it to the bundle.

  • How to import "static files" into HTMLDB 2.0

    Hello!
    I have a problem with "static files" in HTMLDB 2.0.
    First i exported the "static files" from a workspace.
    the result is a ".sql" file.
    now i want to import this file into another workspace.
    but in HTMLDB theres no option to import "static files".
    Hope someone could help me to solve this problem!
    Best regards
    Bastian

    Bastian - Sorry, that facility is not in 2.0. You'll have to import static files into the new workspace individually.
    Scott

  • Simple X-fi Question, Please Help

    !Simple X-fi Question, Please HelpL I've been looking for an external sound card that is similar to the 2002 Creative Extigy and think I may found it in the Creative X-Fi. I have some questions about the X-fi though. Can the X-fi:
    1. Input sound from an optical port
    2. Output that sound to 5. surround- Front, surround, center/sub
    3. Is the X-Fi stand-alone, external, and powered by a USB or a wall outlet (you do not need a computer hooked up to it)
    Basically I want to connect a TosLink optical cable from my Xbox to the X-Fi. That will deli'ver the sound to the X-Fi. Then I want that sound to go to a 5. headset that is connected to the X-fi via 5. front, surround, and center/sub wires. The X-Fi has to be stand-alone and cannot be connected to a PC to do this.
    Thank you for your help.

    The connector must match, and the connector polarity (plus and minus voltage) must match.  Sorry, I don't know if the positive voltage goes on the inside of the connector or the outside.    Any wattage of 12 or more should be adequate.
    Message Edited by toomanydonuts on 01-10-2008 01:29 AM

  • ReportMigration Using LCM & Simple Import & Export.

    Hi,
    I just want to know the difference between these two.. migrating the reports using LCM or by a simple import & export.
    Will LCM even migrate the user security which is associated with the report??
    Can anybody throw some light on this.
    Thanks
    Jagadesh R K.

    Yes, LCM can be used to export / import Reports / Application provisioning.
    For more details, refer the below documents
    EPM 11.1.1.x
    http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_lifecycle_management.pdf
    System 9.3.1
    http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/hss_alcm_util.pdf
    Hope this helps.
    Regards,
    Manmohan Sharma

  • No option to import GIFT question as pretest

    I'm importing a gift file, and it appears to default to "Graded", with no option to change it to Pretest.  Not a huge problem with smaller courses but it would be nice to import pretest questions as well. Unless I'm just missing something?

    I think the likely reason has to do with where the Pretest questions need to be located (prior to any other quiz questions in the timeline) and the fact that they all need to belong to the same Pretest group.
    In any case, I tend to agree that it would have been better (from an instructional designers view) to have more freedom.  But we don't build Captivate, only use it.

  • Importing Quiz Questions

    I'm trying to find a way to reuse some questions in my course for inclusion in a Final Quiz, without having to reinput all of the questions.
    I made a copy of my course and imported the questions I wanted for my Final Quiz. I didn't think I could use these, as they had the same interaction ID as the questions in my course. Is there a way around having to reinput questions from my course I want to include in a Final Quiz without retyping all and have my scoring work property when reporting to LMS?
    Thanks very much.
    Susan

    Yes, you can change them, just make sure they are unique within the quiz. They are auto generated to keep them from being repeated.
    Usually I've seen the quiz import tool create new unique interaction id's for questions. The only time I have seen the interaction ID repeated is if you use the copy/paste function to recreate the quiz slides. However, it has been a while since I used the import quiz tool.
    The cat-on-keyboard method is one trick I have seen used to keep the id's random.

  • Simple Crop tool question... how do I save the crop section?

    Hi,
    I have a very simple crop tool question. I'm a photoshop girl usually... so Illustrator is new to me. When I select the crop section I want... how do I save it?... if I select another tool in the tool panel, the crop section disappears and I can't get it back when I re-select Crop tool. If I select Save as... it saves the whole document...and not just my crop section.
    Like I said, simple question...but I just don't know the secret to the Illustrator crop tool.
    Thanks!
    Yzza

    Either press the Tab key or F key.

  • A Simpler, More Direct Question About Merge Joins

    This thread is related to Merge Joins Should Be Faster and Merge Join but asks a simpler, more direct question:
    Why does merge sort join choose to sort data that is already sorted? Here are some Explain query plans to illustrate my point.
    SQL> EXPLAIN PLAN FOR
      2  SELECT * FROM spoTriples ORDER BY s;
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT |              |   998K|    35M|  5311   (1)| 00:01:04|
    |   1 |  INDEX FULL SCAN | PKSPOTRIPLES |   998K|    35M|  5311   (1)| 00:01:04|
    ---------------------------------------------------------------------------------Notice that the plan does not involve a SORT operation. This is because spoTriples is an Index-Organized Table on the primary key index of (s,p,o), which contains all of the columns in the table. This means the table is already sorted on s, which is the column in the ORDER BY clause. The optimizer is taking advantage of the fact that the table is already sorted, which it should.
    Now look at this plan:
    SQL> EXPLAIN PLAN FOR
      2  SELECT /*+ USE_MERGE(t1 t2) */ t1.s, t2.s
      3  FROM spoTriples t1, spoTriples t2
      4  WHERE t1.s = t2.s;
    Explained.
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT       |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   1 |  MERGE JOIN            |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   2 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   3 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    |*  4 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   5 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    Predicate Information (identified by operation id):
       4 - access("T1"."S"="T2"."S")
           filter("T1"."S"="T2"."S")I'm doing a self join on the column by which the table is sorted. I'm using a hint to force a merge join, but despite the data already being sorted, the optimizer insists on sorting each instance of spoTriples before doing the merge join. The sort should be unnecessary for the same reason that it is unnecessary in the case with the ORDER BY above.
    Is there anyway to make Oracle be aware of and take advantage of the fact that it doesn't have to sort this data before merge joining it?

    Licensing questions are best addressed by visiting the Oracle store, or contacting a salesrep in your area
    But I doubt you can redistribute the product if you aren't licensed yourself.
    Question 3 and 4 have obvious answers
    3: Even if you could this is illegal
    4: if tnsping is not included in the client, tnsping is not included in the client, and there will be no replacement.
    Tnsping only establishes whether a listener is running and shouldn't be called from an application
    Sybrand Bakker
    Senior Oracle DBA

  • SImple but important java question

    hello all,
    just been revising for an exam and just have come across this bit where my notes are trying to explain that arguments passed to java methods are PASSED BY VALUE, and the example is this:
    public class TestSwap {
       public static void swap( int x, int y )
          int temp;
          temp = x; x = y; y = temp;
          return;
       public static void main( String [] args )
          int a = 4;
          int b = 5;
          swap( a, b );
          System.out.println( "a=" + a ); // 4
          System.out.println( "b=" + b ); // 5
    }Isn't this obvious since when a and b are printed out they are already 4 and 5 because of this:
          int a = 4;
          int b = 5;And the method swap(a,b) method might not just as well be there. because it won't have an affect on when a and b are pinted out???!!!!
    Am I jumping the gun, if so can some please explain, i know its important but i cant see it!
    Thanks :)

    Ok, we are proving, got it.
    What the, i cant work out how this works! The example
    you gave?
    Is it because of the arrays referencing
    a[0]...a[1]..etc????!!!Note the difference between swapping a and b vs. swapping a[0] and b[0]. Also, if there were a member variable, swapping a.thing and b.thing would be reflected in the caller.
    With your initial example, we're changing the values of the variables, and since the method and the caller each have their own copies of those variables, the caller is not affected. (Note that only a primitive, a reference or null, can be a variable's value in Java, never an object.)
    With array elements and member variables of parameters, we're changing the contents of the objects pointed to by those variables. Since there's only a single object for each parameter, and the method's variable and caller's variable both point to that same object, both see the change.
    References are passed by value, so changing the reference's value (which object it points to) doesn't affect the caller. But only the reference is copied, not the object, so changing the state of the object will be seen by the caller.

  • Simple import/export workflow question

    I don't use LR myself but I'm trying to plan out what I thought might be a fairly simple workflow for a photographer to get lightroom to spit out watermarked images at a certain size ready to upload via ftp to his website.
    So far I have discovered that Lightroom does not offer simple ftp upload, it always wants to create a gallery of some sort whereas I just want an image dump into a folder on the server.
    Secondly, if I try to export files to a folder on my Mac there's no way of getting them watermarked.
    Anyone here fancy some simple step by step advice?
    thanks
    A

    I also have a MAC and the interface is the same (the locations of the apps are obviously different). It may be that I use LR/Mogrify in this case rather than LR2/Mogrify as I have both installed and mix and match modules from the two plug ins (both work with LR2 on windows and OSX). I have been mixing and matching the modules from the two plug ins for so long I don't actually know which is which! Try installing LR/Mogrify as well as LR2/Mogrify and see.

  • A simple import question about previously existing folders

    I just bought Lightroom (so excited!) and am importing my photos. I already have a pretty significant organization of folders on my Mac for all my photos. Does Lightroom recognize all previous folders and I can just move them in bulk or do I need to import them folder by folder? Thanks!

    Simply select Pictures or the root folder and in the import dialog choose "Add"
    Lightroom does not hold images it will reference the folders and files on your hard drive or connected external hard drive.
    Go to the Library menu and put a check-mark against "Show photos in sub folders"

  • Simple import question

    I am trying to import a movie from my camcorder to my mac to begin a movie project. As instructed, my camcorder is on play mode, i click on "create a new project". I name a project and click "create". You are then supposed to get a blue screen with "import" on it. I am getting a screen that plays music and says travel card, slideshow, etc. What am I doing wrong?
    pat

    Welcome to the forums.
    Your answer might be as easy as switching to iMovie. Even if you plan to create a DVD, you'll want to import from your camcorder into iMovie (rather than iDVD).
    John

  • Very simple and quick question about Arrays

    Hi,
    I have the following code to produce a student grades provessing system. I have got it to store data in the array, i just cant figure out how to add the integers from the row to produce a total. Thats all I want to do create a total from the 6 marks and add a percentage.
    Any help would be greatly appreciated.
    -------------CODE BELOW----------------------
    import java.util.*;
    public class newstudent1_2
    public static void main (String[]args)
    System.out.println ("-----------------------------------------------"); //Decorative border to make the welcome message stand out
    System.out.println (" Welcome to Student Exam Mark Software 1.2"); //Simple welcome message
    System.out.println ("-----------------------------------------------");
    int [][] mark;
    int total_mark;
    int num_students;
    int num_questions = 9;
    Scanner kybd = new Scanner(System.in);
    System.out.println("How many students?");
    num_students =kybd.nextInt();
    mark = new int[num_students][num_questions] ;
    for (int i=0; i<num_students; i++)
    System.out.println("Enter the Students ID");
    String student_id;
    student_id =kybd.next();
    System.out.println("Student "+i);
    for( int j=1; j<num_questions; j++)
    System.out.println("Please enter a mark for question "+j);
    mark[i][j]=kybd.nextInt();
    System.out.print("id mark1 mark2 mark3 mark4 mark5 mark6 mark7 mark8");
    //This section prints the array data into a table
    System.out.println();
    for (int i=0; i<num_students; i++)
    for( int j=0; j<num_questions; j++)
    System.out.print(mark[i][j]+"\t"); //the \t is used to add spaces inbetween the output table
    System.out.println();
    --------------END OF CODE---------------
    Thanks.

    I had to do this same sort of thing for a school assignment but i didnt use an array.
    import java.text.DecimalFormat;
    import TurtleGraphics.KeyboardReader;
    public class grade_avg
         public static void main(String[] args)
              int grade, total = 0, count = 0;
              double avg = 0.0;
              KeyboardReader reader = new KeyboardReader();
              DecimalFormat df = new DecimalFormat("0.00");
         for (;;)
                   grade = reader.readInt("Please enter a grade: ");
              if (grade > 0)
                        total = total + grade;
                        count ++;
              if (grade == 0)
                        avg = total / count;
                        System.out.println("The average is: " + df.format(avg));
                        System.exit(0);
    }output looks like:
    Please enter a grade: 100
    Please enter a grade: 50
    Please enter a grade: 0
    The average is: 75.00

Maybe you are looking for